Sun GlassFish Mobility Platform 1.1 Installation Guide

Running the Secure MusicDB Client Application

    Start the client emulator on a Windows system:

  1. Choose Start->All Programs->Sun Java Wireless Toolkit 2.5.2 for CLDC->Wireless Toolkit 2.5.2.

    The Sun Java Wireless Toolkit 2.5.2 for CLDC screen is displayed.

  2. To configure the toolkit security settings, complete the following steps:

    1. Select Edit from the menu bar and then select Preferences.

      The Preferences screen is displayed.

    2. Select Security in the Category pane.

      The Security tab is displayed.

    3. Ensure that MSA is selected for the Security Policy.

    4. Ensure that maximum is selected for the Security domain.

    5. Click OK when you are done.

      The console will display messages indicating that your Preferences have been updated and saved.

  3. If you plan to use HTTPS instead of HTTP as the transport between the mobile client (the toolkit) and the gateway, complete the following steps:

    1. Change to the config subdirectory in the Gateway tier Sun GlassFish Mobility Platform installation:


      $ cd as-install/domains/domain-dir/config
      
    2. Export the keystore to a file:


      $ keytool -export
      -keystore keystore.jks
      -alias s1as
      -file sjsas.cer
      -storepass adminpass
      
    3. Copy the exported keystore to the system from which you will run the toolkit.

    4. In the toolkit, select File from the menu bar, then select Utilities.

    5. Select Manage Certificates and press the Launch button.

    6. In the Java ME Platform Certificate Manager, select Import Certificate.

    7. Locate the certificate, s1as.cer, that you generated in step 3b and copied locally and press Import.

    8. Select Maximum from the Select Security Domain drop-down and then press OK.

      The Key Details pane, on the right side of the window, reports that the certificate has been imported and is enabled.

  4. Select File from the menu bar, then select Create project from JAD/JAR file.

    The Create new project from JAD screen is displayed.

  5. Locate the secure-musicdb.jad file in the samples/secure-musicdb subdirectory, then click Open.

    After the WTK opens the project, it displays the following message:


    Project "secure-musicdb" loaded
  6. Click Run in the toolbar.

    The emulator appears with MepSecureJdbcMIDlet selected.

  7. To launch the client application, click Launch (the top right button on the keypad, with a dot on it).

    The Initialize PIN screen displays.

  8. In the Enter Secret field, type any sequence of characters. You do not need to remember what you typed.

  9. In the Set Your PIN field, type a sequence of alphanumeric characters. You can type up to 32 characters but keep in mind that you need to remember what you typed for your PIN.

  10. Click OK.

    The Sun GlassFish Mobility Platform JDBC Client configuration screen displays. This screen includes several settings for the application.

  11. In the sync server url field, type http://hostname.dnsdomainname:port-number/sync.

    You'll need to edit the URL that is shown by default.

    If you have a two-tier Sun GlassFish Mobility Platform installation, type the hostname.dnsdomainname :port-number of the tier1, or Gateway tier, system.

  12. In the email field, type the email address that you used when you created the musicdbuser in Configuring the Gateway (for example, musicdbuser@mycompany.com).

  13. In the password field, type musicdbpass.

  14. In the syncType pane, use the emulator arrow keys and the Select button (the big square button) to select Slow sync.

  15. Click Menu and select Sync.

    A Sync Successful message appears briefly, followed by a description of the synchronization results.

  16. To verify that the albums have been downloaded from the server, click Menu then select Albums.

    The three albums that you created in Populating the album Table appear.

  17. Create a new album.

    1. Click Menu and select New Album.

    2. Type data in the Name, Artist, Publish Date, and Rating fields and click OK when you are done.

      The album name appears with a .alb suffix.

    3. Click Back.

      The Sun GlassFish Mobility Platform JDBC Client screen appears.

  18. Synchronize the data with the MusicDB database.

    1. Select the Two-way sync type, then click Menu and then select Sync.

      A Sync Successful message appears, and the synchronization results are displayed.

    2. Click Ok.

      The albums are displayed.

      The data on your client device and the data in the MusicDB database are now synchronized.