UltraLite.NET User's Guide
Understanding UltraLite Development
This section describes special steps that you must take to add ActiveSync to your application, and how to register your application for use with ActiveSync on your end users' machines.
Synchronization requires SQL Anywhere Studio. For general information on setting up ActiveSync synchronization, see Deploying applications that use ActiveSync in the MobiLink Synchronization User's Guide. For general information on adding synchronization to an application, see Synchronizing UltraLite applications.
ActiveSync synchronization can be initiated only by ActiveSync itself. ActiveSync can automatically initiate a synchronization when the device is placed in the cradle or when the Synchronization command is selected from the ActiveSync window.
When ActiveSync initiates synchronization, the MobiLink ActiveSync provider starts the UltraLite application, if it is not already running, and sends a message to it. Your application must implement an ActiveSyncListener to receive and process messages from the MobiLink provider. Your application must specify the listener object using:
dbMgr.SetActiveSyncListener( "MyAppClassName", listener );
where MyAppClassName is a unique Windows class name for the application. For more information, see in the API Reference.
When UltraLite receives an ActiveSync message, it invokes the specified listener's ActiveSyncInvoked(boolean) method on a different thread. To avoid multi-threading issues, your ActiveSyncInvoked(boolean) method should post an event to the user interface.
If your application is multi-threaded, use a separate connection and use the synchronized keyword to access any objects shared with the rest of the application. The ActiveSyncInvoked() method should specify a StreamType.ACTIVE_SYNC for its connection's SyncParms.Stream and then call Connection.Synchronize().
When registering your application, set the following parameters:
Class Name The same class name the application used with the Connection.SetActiveSyncListener method.