Company
Date Published
Author
James Nocentini, Technical Writer, Mobile, Couchbase
Word count
662
Language
English
Hacker News points
None

Summary

An Android application allows users to save reviews with a rating and name to a Couchbase Lite database, utilizing TabLayout and ViewPager components to present three scenarios: Unique, Conflict, and P2P. In the Unique tab, a randomly generated _id field is created for each new document, while the Conflict tab enables users to set the _id field manually, allowing documents to be updated if an existing ID is used. The P2P tab facilitates continuous replication with a remote database by inputting its URL, which can be customized in the StorageManager.java file. A table displays review counts and conflicting revisions across tabs, with live queries updating the Recycler View adapter as changes occur. To deploy the application, a Sync Gateway and Couchbase Server instance can be set up using Tutum, requiring specific configurations for the Sync Gateway to function correctly. Additionally, a script is available for deleting all documents from a target database.