Testing the Device Application on the BlackBerry Simulator

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

  1. In WorkSpace Navigator, right-click SUP101BlackBerry 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 you have run the simulator, cancel the Setup screen.
    BlackBerry
                            Tutorial
                            Simulator
                            Setup
                            Screen
  2. On the main window, click All to access the applications screen, then scroll until you see the SUP101BlackBerry application.

    BlackBerry
                            Tutorial
                            Applications
                            Screen
                            with
                            SUP101BlackBerry
                            Application
  3. Click SUP101 BlackBerry to launch the application.

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

    During initialization, 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 SUP101BlackBerry 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.


    BlackBerry
                            Tutorial SUP101BlackBerr
                            Application
                            Customer List
                            Screen
  4. Select the customer to update.

    BlackBerry Tutorial SUP101BlackBerry Application Update Customer
                            Screen
  5. Change the first name of the customer and click submit.

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

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

    The customer list appears, and shows the name change you made.
  6. Close the simulator to stop the SUP101BlackBerry application.