Trying out MobiLink synchronization

This section describes how to try out the ASA MobiLink Synchronization wizard in a sample application. To get started, create a new workspace and a template application. You do not need to create a SQL database connection, but you do need to create a project.

Before you use the wizard to generate objects for the application, you need to set up a remote database and add at least one publication, user, and subscription to it, and create a PowerBuilder database profile for the remote database. To test the synchronization objects from your application, you need to set up a consolidated database. You can create your own remote and consolidated databases, as described in the chapter on MobiLink synchronization in Application Techniques.

To test the synchronization objects, complete the following steps:

  1. Run the wizard.

  2. Call synchronization objects from your application.

  3. Deploy the application and database files.

  4. Start the MobiLink server.

  5. Run the application.

Run the wizard

You start the wizard from the Database tab of the New dialog box. The wizard prompts you for a database profile and a publication, although you can enter this information at a later time after you generate synchronization objects.

StepsTo run the MobiLink synchronization wizard

  1. Select File>New from the PowerBuilder menu bar.

  2. Click the Database tab, select the ASA MobiLink Synchronization wizard, and click OK.

  3. Follow the instructions in the wizard, providing the information the wizard needs.

    For help using the wizard, place the mouse pointer in any wizard field and press F1.

    On the last page of the wizard, make sure the Generate To-Do List check box is selected if you want the wizard to add items to the To-Do List to guide and facilitate your development work.

  4. When you are satisfied with your choices in the wizard, click Finish.

    The wizard generates objects that you can use for database synchronization.

Call synchronization objects from your application

Open a menu for your application in the Menu painter and add two submenu items to the File menu, called Synchronize and Sync Options. Add the following code to the Clicked event of the Synchronize menu item (appname is the name of your application):

syncparm s_opt
gf_appname_sync(s_opt)

Add the following code to the Clicked event of the Sync Options menu item:

gf_appname_configure_sync()

Deploy the application and database files

Use the Project painter to deploy the application to the desktop and copy this to all computers that will be connecting remotely to the MobiLink server. You need to copy the remote database to all end-user computers, and either register the database as an ODBC database or include connection parameters in a data source name (DSN) file.

For information on additional files and registry entries required on end-user computers, see the chapter on MobiLink synchronization in Application Techniques.

Start the MobiLink server

Select MobiLink Synchronization Server from the Utilities folder in the Database painter. Fill in the required information and click OK to start the server.

For more information, see “Starting the MobiLink synchronization server”.

Run the application

Run the application on the remote computer and select the File>Synchronize and File>Sync Options menu items to test their operation.