by Marty Schoch (marty@couchbase.com) + Traun Leyden (tleyden@couchbase.com)
Couchbase-Lite-Android is the Android port of Couchbase Lite iOS.
Click here for official documentation for Couchbase Lite Android
-
Download and run the Grocery-Sync demo application
-
Create your own Hello World Couchbase Lite via the Getting Started guide.
If you are just building an application with Couchbase Lite, you can skip the rest of this document. (see Getting Started with Couchbase Lite)
However, if you need to debug Couchbase Lite Android or otherwise hack on it, these instructions will help you do that.
-
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
You should be able to import the project directly into Android Studio:
- Start Android Studio
- Choose File / Import and choose the couchbase-lite-android/CouchbaseLiteProject directory screenshot
- Choose Import from External Model and make sure Gradle is selected screenshot
- Check the auto-import and the Use gradle wrapper (recommended) checkboxes screenshot
- Hit Finish and wait for all tasks to finish (may take a while)
After it's finished with the import, it should look like this
At this point, unfortunately, if you open the CBLServer
class, it will look like this. Android Studio will say it cannot resolve some objects. This seems to be due to a bug in the import process.
To fix this:
- Go to File / Project Structure
- Choose Modules
- Choose the CBLite module
- Change the jackson-core-asl-1.9.2 and jackson-mapper-asl-1.9.2 dependencies from "test" to "compile" screenshot
- Hit Apply
Note: you may need to do this in other places for other libraries if you run into situations where Android Studio cannot resolve code.
Note: the above workarounds are only needed for Android Studio, and even without these the command line gradle builds should still work.
See the Running the Test Suite wiki page.
If you want to host and deploy your own maven artifacts, see the upload_android_artifacts.sh
script.
- GrocerySync
- LiteServAndroid
- CouchChatAndroid -- just a stub at this point.
- Alpha / Developer Preview
- Android 2.3 Gingerbread (API level 9) and above.
- Apache License 2.0