Run the SUP101Sample application on the BlackBerry simulator, and change customer information to update the interface.
The application registers and synchronizes data from the server in the background.
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.
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.