Hi everyone i am using couch-base lite concept to store data locally in my android app.this concept is working but i am facing one issue like if i am 2 taking reading from weighing scale offline such as 50kg and 60 kg.when i am trying to test app by making mobile data on i observed 60 kg which is latest reading replace 50 kg.means on my site 60 kg printed two times.
Query query = mDatabase.createAllDocumentsQuery();
query.setAllDocsMode( Query.AllDocsMode.ALL_DOCS );
// query.setAllDocsMode( Query.AllDocsMode.SHOW_CONFLICTS);
QueryEnumerator result = query.run();
System.out.println( "data count from DB" + result.getCount() );
int count = 0;
for (Iterator<QueryRow> it = result; it.hasNext(); ) {
QueryRow row = it.next();
System.out.println( "createAllDocumentsQuery:-" + row.getDocumentId() );
Document docData = mDatabase.getDocument( row.getDocumentId() );
count = count + 1;
System.out.println( "Iteration Count is: " + count );
//Delete all content of database
//docData.delete();
// System.out.println( docData.getProperties() + "device data:-" + docData.getProperty("deviceData").toString());
System.out.println( "retrievedDocument=" + String.valueOf( docData.getProperties() ) );
Map<String, Object> properties = new HashMap<String, Object>();
properties = docData.getProperties();
is my code right? or something is missing?