Contents Index Assigning user-defined code to segments Adding TCP/IP, HTTP, or HTTPS synchronization to Palm applications

UltraLite Static C++ User's Guide
  Developing UltraLite Applications for the Palm Computing Platform

Adding HotSync synchronization to Palm applications


If you use HotSync, then you synchronize by calling ULData.PalmLaunch when your application is launched, and ULData.PalmExit when your application is closed. Do not use ULConnection.Synchronize for HotSync synchronization.

To call HotSync synchronization from your application you must add code for the following steps:

  1. Prepare a ul_synch_info structure.

  2. Call ULData.PalmExit function, supplying the ul_synch_info structure as an argument.

    This function is called when the user switches away from the UltraLite application. You must ensure that all outstanding operations are committed before calling ULData.PalmExit. The ul_synch_info.stream parameter is ignored, and so does not need to be set.

    For example:

    ul_synch_info info;
    ULInitSynchInfo( &info );
    info.stream_parms =
      UL_TEXT( "stream=tcpip;host=localhost" );
    info.user_name = UL_TEXT( "50" );
    info.version = UL_TEXT( "custdb" );
    
    if( !ULPalmExit( &sqlca, &info ) ) {
      return( false );
    }
  3. Call ULData.PalmLaunch.

For more information, see Launching and closing UltraLite applications, and Synchronization parameters.

A MobiLink HotSync conduit is required for HotSync synchronization of UltraLite applications. If there are uncommitted transactions when you close your Palm application, and if you synchronize, the conduit reports that synchronization fails because of uncommitted changes in the database.

Specifying the stream parameters 

The synchronization stream parameters in the ul_synch_info structure control communication with the MobiLink synchronization server. For HotSync synchronization, the UltraLite application does not communicate directly with a MobiLink synchronization server; it is the HotSync conduit instead.

You can supply synchronization stream parameters to govern the behavior of the MobiLink conduit in one of the following ways:

See also 

For information about configuring HotSync, including a description of how to set up your MobiLink HotSync conduit, see Configuring the MobiLink HotSync conduit.


Contents Index Assigning user-defined code to segments Adding TCP/IP, HTTP, or HTTPS synchronization to Palm applications