Basic implementation of the TodoLite sample app and step by step tutorial to learn how to build it from scratch:
- Node.js 4 or above
- Android Studio and emulator
Install the Node.js dependencies:
$ npm install
Start the React Native daemon:
$ npm start
Build and install the Android application in an emulator or device:
$ ./gradlew installDebug
Open the app. Thanks to the React Native daemon, you can change the UI code written in JavaScript and see the changes instantly updated. On Genymotion, use the ⌘ + m
to display the settings pop-up and click on Reload JS
.
Download Sync Gateway from the link below and unzip the file:
And run Sync Gateway with this config provided in this project:
~/Downloads/couchbase-sync-gateway/bin/sync_gateway /path/to/project/sync-gateway-config.json
To make the Sync Gateway endpoint reachable inside of the Android VM emulator, you need to enable a port from the host to the VM. In Terminal, run the following:
adb reverse tcp:4984 tcp:4984
Open the Admin UI to monitor the documents that were saved to Sync Gateway:
Try adding more task documents and notice how they get pushed to Sync Gateway automatically.