Test the application on the desktop

Note

Before you run your application in PocketBuilder to preview and test it, you need to start the MobiLink server.

  1. Close any painters that are open in PocketBuilder.

    Select Tools>Database Profile to open the Database Profiles tool.

  2. Expand the ODB ODBC node and then expand the Utilities node.

    Double-click the MobiLink Synchronization Server utility.

    Shown is the Database Profiles painter. The selected item in the painter tree view is the MobiLink Synchronization Server. It is located under the Utilities folder for O D B O D B C connnections.
  3. For the MobiLink version, select SQL Anywhere 10.

    For the ODBC connection string, type DSN=SalesDB.

    Shown is the MobiLink Synchronization Server Options dialog box that lets you start the MobiLink Server. In this dialog box you set the MobiLink server version and the O D B C connection string. For this tutorial, the connection string is D S N equals Sales D B.
  4. Click OK.

    The MobiLink Synchronization Server runs and is ready to accept requests.

    Shown is the MobiLink Server console. It indicates that the connection to the consolidated database is established and the MobiLink server is started.
  5. Close the Database Profiles painter.

  6. Select Run>salesdb_tutorial from the menu bar.

    The SalesDB application connects to the local copy of the SalesDB_remote remote database and the Sync Options dialog box opens.

    In the Sync Options dialog box, you can type syncronization information including the MobiLink user name and password.

  7. For testing purposes, type 50 as the user name in the MLUser text box, leave the MLPassword text box blank, and maintain the default for all other options.

    Shown is the Synchronization options window. The publication to be synchronized is listed as sales a p i, however, this is grayed out and the user cannot change it at runtime. The MobiLink User is listed as the integer fifty and the password is left empty.

    If you use 50 as the user name now, when you run the application on your device or emulator you should use another user name such as 51 or 52.

    NoteDefault protocol and host For ease of testing, the default protocol is TCP/IP and the default host is the machine name or the machine IP number. The default port is 2439 for TCP/IP, 80 for HTTP, and 443 for HTTPS.

  8. Click OK to synchronize.

    First the synchronization completes.

    Shown is the Synchronization status window indicating the number of rows that have been inserted, updated, or deleted, and that the synchronization is complete.
  9. Click OK when the synchronization completes.

    The application starts on the desktop.

    Shown is the running application with the first row of information from the database. Visible are the customer name, product, quantity, price, discount, and status of the order.

    Since you can run PocketBuilder applications from the design-time environment, it is possible to develop and test applications without a device or emulator.

    Now you test your application.

  10. Explore the layout of the application.

    Click the Order>New menu item and add a new order.

    Shown is the window to add a new order to the database. It has fields for the customer, product, quantity, price, and discount offered.

    The application handles orders that have been modified in the remote database.

  11. Click the Next, Approve, and Deny buttons.

    Here the Approve button is clicked and the Good Work note is selected.

    Shown is the Message box to indicate that an order was approved. The message says "Good work!"
  12. Click the OK button to close the Note.

    Select File>Exit to exit the application and return to PocketBuilder.