Overview | Backend | App Configuration | Android | iOS |
MBO Android App | OData Android App |
OData Android Content:
Read Operations
In this section will cover how to access data from the device's local database
In MBO based mobile apps, developers can use the find, findAll, or findByPrimaryKey methods in the MBO class
In OData based mobile apps, developers can access the local database when the offline store state is “Open”. The offline store does not provide methods like find, findAll or findByPrimaryKey, instead it provides methods to send GET request with filters in the URL to reduce the amount of data that will need to be displayed. For example the URL BusinessPartners?$filter=Country eq 'US' will retrieve the business partners located in the US.
The offline store offers both asynchronous and synchronous functions for OData operations. There are a variety of methods that developers can use to access data from the local database, in this case the OfflineStoreManager class is using store.scheduleRequest method to send an asynchronous GET request. This method receives:
ODataRequestParamSingle request = new ODataRequestParamSingleDefaultImpl();
request.setMode(ODataRequestParamSingle.Mode.Read);
request.setResourcePath(collection);
request.setCustomTag(customTag);
offlineStore.scheduleRequest (request,requestListener );
Below there’s a diagram that show the flow for asynchronous GET request to access data from the device local database.
Please note we have submitted this sample app for publishing and it will be available in a Git repository soon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
43 | |
25 | |
17 | |
15 | |
11 | |
7 | |
7 | |
6 | |
6 | |
6 |