Couchbase-Lite-Android is a lightweight embedded NoSQL database engine for Android with the built-in ability to sync to Couchbase Server on the backend.
It is the Android port of Couchbase Lite iOS.
Couchbase Lite databases are able to sync with eachother via Sync Gateway backed by Couchbase Server
-
Download and run the GrocerySync demo application
-
Create your own Hello World Couchbase Lite via the Getting Started guide.
Maven repo URL: http://files.couchbase.com/maven2/
<dependency>
<groupId>com.couchbase.lite</groupId>
<artifactId>android</artifactId>
<version>0.0.0-396</version>
</dependency>
While 0.0.0-396
was the latest build at the time of writing, it's probably out of date by the time you are reading this. To get the latest build number (eg, the "396" part of the version above), see our Maven Repo and look for the highest numbered version that starts with 0.0.0-
and is later than 0.0.0-396
Here is a complete gradle file that uses this maven artifact.
Maven repo URL: http://files.couchbase.com/maven2/
<dependency>
<groupId>com.couchbase.lite</groupId>
<artifactId>android</artifactId>
<version>1.0.0-75</version>
</dependency>
For Eclipse and Phonegap users, here are links to the zip file which includes the jars:
- Master Branch build #396 zipfile - to get more recent builds, see Jenkins CI builds
- 1.0.0 zipfile
-
Download Android Studio. Versions 0.5.7 and 0.5.8 are known to work. Anything older will almost certainly not work. Newer versions after 0.5.8 may or may not work. (if not, please report an issue)
-
Under Tools / Android / Android SDK Manager and install "Extras/Google Repository" and "Extras/Android Support Repository" (future versions of Android Studio may make this step unnecessary)
Use Git to clone the Couchbase Lite repository to your local disk:
$ git clone git://github.com/couchbase/couchbase-lite-android.git
$ cd couchbase-lite-android
$ git submodule init && git submodule update
cp local.properties.example local.properties
- Customize
local.properties
according to your SDK installation directory
cp settings.gradle.example settings.gradle
You should be able to import the project directly into Android Studio:
- Start Android Studio
- Choose File / Import and choose the settings.gradle file in the couchbase-lite-android directory you cloned earlier
- Hit Finish and wait for all tasks to finish (may take a while)
There are two wiki pages which describe how to run the tests:
-
Running the Test Suite wiki page.
- GrocerySync
- Simplest example
- TodoLite
- Facebook auth
- Replication with channels
- Image attachments
- Ability for users to share data
- LiteServAndroid
- REST API example
- Project Structure wiki page that describes the new project structure.
- Android 2.3 Gingerbread (API level 9) and above.
- Apache License 2.0