Skip to content
The android build for humans.
C Java C++ XSLT
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Mobile Couchbase for Android

Apache CouchDB on Android provides a simple way to sync your application data across devices and provide cloud backup of user data. Unlike other cloud solutions, the data is hosted on the device by Couchbase Mobile, so even when the network is down or slow (airplane, subway, backyard) the application is responsive to users.

What this means for you:

  • You can embed the rock solid distributed database, Mobile Couchbase, on your Android device.
  • Your Android apps can use Apache CouchDB's well-proven synchronization technology.
  • If you <3 CouchApps, you can deploy them as Android apps.

Join us

There is a Google Group here for Mobile Couchbase. Let's talk about how to optimize the Erlang build, what the best Java APIs are for CouchDB, how to take advantage of replication on mobile devices. It'll be fun.

Bug Tracker

There is a bug tracker available at

Getting Started

If you have questions or get stuck or just want to say hi, email and let us know that you're interested in Couchbase on mobile.

These instructions require you to have installed Eclipse and the Android SDK, the Android developer website has instructions.

Installing Couchbase into your Application

NOTE: You do not need the source of this repository to use Mobile Couchbase in your Android application.

  1. Create a new Android project or select an existing project

  2. Download the

  3. Extract, you will see 3 files

    • couchbase.xml
    • README.txt
  4. Place and couchbase.xml into the top-level of your project

  5. Right-click on couchbase.xml and select Run As > Ant Build

  6. Refresh your project

Starting Couchbase

Now that your project supports Couchbase, starting Cocuhbase is accomplished by adding a few things to your application's Main Activity.

  1. Create an instance of ICouchbaseDelegate, you can implement these methods to respond to Couchbase events

    private final ICouchbaseDelegate mDelegate = new ICouchbaseDelegate() {
        public void couchbaseStarted(String host, int port) {}
        public void exit(String error) {}
  2. Declare a ServiceConnection instance to keep a reference to the Couchbase service

    private ServiceConnection couchServiceConnection;
  3. Add a method to start Couchbase

        public void startCouchbase() {
                CouchbaseMobile couch = new CouchbaseMobile(getBaseContext(), mCallback);
                couchServiceConnection = couch.startCouchbase();
  4. Call the startCouchbase method from the appropriate Activity lifecycle methods. For many applications the onCreate method is appropriate

    public void onCreate(Bundle savedInstanceState) {


For examples please look at:

Build information

To build the Android-Couchbase project from source run the following ant command:

ant -Dsdk.dir=/path/to/android/sdk dist

Replacing the value for sdk.dir with the path to the Android SDK on the build server.

The current build of Android Couchbase embed the CouchDB binaries. There is information on how to build these binaries on the SourceBuild project.


Portions under Apache, Erlang, and other licenses.

The overall package is released under the Apache license, 2.0.

Copyright 2011, Couchbase, Inc.

Something went wrong with that request. Please try again.