Testing the Device Application on the Android Emulator

Run and test the SUP101Sample application on the Android Emulator.

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



    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 the server in the background.
    Android Tutorial Onboarding Data Image

    In the initialization process, the operation to target change notifications is enabled 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 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 uses 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 whole customer object which results in better performance.

  2. To change customer information, select the customer, for example, Meghan Mason.
    Android Tutorial Customer List Image
  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 changes in the back end initiates Notifications from the server. The device application uses a ChangeLogAPI, specifically GenericList<ChangeLog>changeLogs=SUP101DB.getChangeLogs(query);, to query those managed items and use them to update the user interface if needed.


    Android Tutorial Updated Customer List Image