The Nuxeo Android SDK tries, as much as possible, to expose Nuxeo services in a natural Android way. The idea is that the SDK should it's features via standard Android concepts and patterns.
DocumentsListAdapter is a dedicated implementation of the standard Android interface
It allows to bind an Android
ListView to a
// get the document list LazyDocumentsList documentsList = getDocumentList(data); // define the mapping between document attributes and widgets Map<Integer, String> mapping = new HashMap<Integer,String>(); mapping.put(R.id.title_entry, "dc:title"); mapping.put(R.id.status_entry, "status"); mapping.put(R.id.iconView, "iconUri"); mapping.put(R.id.description, "dc:description"); mapping.put(R.id.id_entry, "uuid"); // create the adapter passing it the list, the mapping and the layout DocumentsListAdapter adapter = new DocumentsListAdapter(this, documentsList, R.layout.list_item, mapping, R.layout.list_item_loading); // bind to the ListView listView.setAdapter(adapter);
Starting from there you can use your Nuxeo doculent list like any simple list. The documents list will be fetched and refreshed automaticaly as needed.
If scrolling goes faster than fetching from the server, a waiting item will be displayed with a specific layout (
R.layout.list_item_loading in the above exemple).
Nuxeo's SDK try to expose as much as possible of the content via the Android
The provider authority is
nuxeo and depending on the requested
URI content, the call will be directed to a nuxeo service.
|URI pattern||Target Content|
||returns all documents of the repository via an Android Cursor|
||access to document with given UUID|
||Android cursor documents in the given provider|
||access to document with UUID in the given provider|
||download and cache icon of the given sub path|
||download and cache the main blob of the doc with the given UUID|
download and cache the blob |
download and cache the blob contained in the field |
This ContentProvider allows :
- to easily bind Nuxeo resources (like images) to Androids Views (like an
- to easily use Nuxeo content from an external application
- Interprocess marshaling is handled by the ContentProvider system
- you don't need to depend on Nuxeo API
Android built-in event system is used by the SDK to notify for :
Network status changes: when the Nuxeo server becomes reachable or when offline mode is required
Configuration changes : when the settings of the NuxeoAutomationClient have been changed
Document events : A notification is sent for Create/Update/Delete operations on
LazyDocumentsLists(with 3 states Local, Server, Failed)