Testing the Device Application on the Android Emulator

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

  1. In WorkSpace Navigator, right-click SUP101Android and select Run As > Android Application.


    Android Tutorial SUP101 Android project Run As Android Application
                                Menu

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

    The application activation (on boarding) image indicates that the application is registering data from Unwired Server.
    Android Tutorial SUP101 Android Project Onboarding Data
                                Window

    During initialization, 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 SUP101Android 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 Android application illustrates a device application with a small buffer (30 customers). In commercial applications, based on the amount of user data, you can use a large buffer (1,000 customers).

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


    Android Tutorial SUP101 Android Project Customer List

  2. Select the customer to update.

    Android Tutorial SUP101 Android Project Highlighted Customer List
                            Screen
  3. In the customer detail screen, change the first name of the customer and click Submit.

    Android Tutorial SUP101 Android Project Customer Detail Screen

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

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

    Android Tutorial SUP101 Android Project Customer Updated Screen
  4. Close the emulator to stop the SUP101Android application.