Testing the Device Application on the Android Emulator

Run the SUP101Sample application on the Android emulator, and change customer information to update the interface.

  1. In Package Explorer, right-click the SUP101Sample and select Run As > Android Application.



    Note: It may take several minutes for the Android emulator's home screen to appear.

    The On Boarding image indicates that the application is registering and synchronizing data from Unwired Server in the background.
    Android Tutorial Onboarding Data Image

    In the initialization process, the system enables the operation to target change notifications using:
    SynchronizationGroup sg=SUP101DB.getSynchronizationGroup("default"); 
    sg.setEnableSIS(true);
    sg.save();
                            
    When the data finishes synchronizing, the device application shows the SUP101Sample Application with a list of customer data in a ListView control. You can scroll through the customer list to see more data and to make changes. The data loads from the database on demand.
    Note: The sample application illustrates a device application with a small buffer (30 customers). In commercial applications, you can use a large buffer (1,000 customers) based on user data.

    When the application queries the customer list, 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.



  2. To change customer information, select the customer, for example, Meghan Mason.


  3. In the customer detail screen, change the first name of the customer and click Submit.

    Android Tutorial Customer Detail Image

    The Submit button is mapped to the synchronize operation using SUP101DB.beginSynchronize. The synchronization occurs in the background so the user interface is not affected.

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

    Android Tutorial Updated Customer List Image
  4. Close the emulator to stop the SUP101Sample application.