Lesson 4: Run the application on the simulator

Before you can run the BlackBerry application and synchronize, the MobiLink server must be running. The MDS Simulator must also be running to provide a communications channel between the device simulator and MobiLink.

  1. Start MobiLink by running the following command from c:\tutorial\database\:
    mlsrv11 -c " DSN=HelloBlackBerry" -v+ -x http(port=8081) -ot ml.txt

    The -c option connects MobiLink to the SQL Anywhere database. The -v+ option sets a high level of verbosity so that you can follow what is happening in the server window. The -x option indicates the port number being used for the communications. The -ot option specifies that a log file (ml.txt) is to be created in the directory where you started the MobiLink server.

  2. Choose Start » Programs » Research In Motion » BlackBerry Email And MDS Services Simulator 4.1.2 » MDS.
  3. Enter names at the server.
    1. Start Interactive SQL and connect to the HelloBlackBerry data source.
    2. Run the following SQL statements add names:
      INSERT Names ( Name ) VALUES ( ‘ServerName1’ );
      INSERT Names ( Name ) VALUES ( ‘ServerName2’ );
      COMMIT;
  4. From the JDE, press F5 to compile your application and run it in the device simulator.
  5. Navigate to the main screen and add names to the list.
  6. Synchronize the application.
  7. From the main screen, display the menu items and choose Sync.

    The names entered at the server appear in the screen. If you query the names in the Names table from Interactive SQL, you should see that any names you have entered in the simulator have reached the server.