Testing the Device Application on the BlackBerry Simulator

Run the SUP101Sample application on the BlackBerry simulator, and change customer information to update the interface.

Depending on the simulator you are using, the screens may vary.
  1. In Package Explorer, right-click the SUP101Sample project and select Run As > BlackBerry Simulator.
    It may take several minutes for the BlackBerry simulator's Setup screen to appear. If this is the first time running the simulator, cancel the Setup screen.
    BlackBerry simulator Setup page
  2. On the main window, click All to access the applications screen, then scroll until you see the SUP101Sample application.

    BlackBerry applications screen with SUP101Sample
  3. Click SUP101Sample to launch the application.

    The application registers and synchronizes data from the server in the background.

    In the initialization process, the system enables the operation to target change notifications using:
    SynchronizationGroup sg=SUP101DB.getSynchronizationGroup("default"); 
    sg.setEnableSIS(true);
    sg.save();
                            

    After the application initializes, the device application shows the SUP101Sample application with a list of customer data. You can scroll through the customer list to see more data, search, and make changes. The data loads from the database on demand.

    When the application queries the customer list, it uses a named query findAll. If the customer list is long, it uses a SUP101DB.executeQuery() API to get only columns that are needed, such as (fname, lname...), instead of the entire customer object; this results in better performance.


    SUP101Sample application Customer List screen
  4. Focus on the customer list and in the Search bar, enter dal.
    The customer list is filtered and only customers with a first or last name beginning with "dal" are shown, in this case, Daljit Sinnot.
  5. Select the customer, Daljit Sinnot, and click the trackball.
    The Update Customer screen for Daljit Sinnot appears.
    SUP101Sample application Update Customer screen
  6. Change the first name of the customer to abc and click submit.

    The submit button maps to the update operation of the customer mobile business object. The synchronize operation uses SUP101DB.beginSynchronize and occurs in the background so the user interface is not affected. When the application synchronizes, any pending operations are uploaded to Unwired Server.

    Any changes in the back end initiate notifications from the server. The device application uses a ChangeLog API, specifically ObjectList changeLogs = SUP101DB.getChangeLogs(query);, to query those managed items and use them to update the user interface if needed.

    The customer list appears with the name change you made.
  7. Close the simulator to stop the SUP101Sample application.