Couchapp example using TouchDB-Android
Switch branches/tags
Nothing to show
Pull request Compare This branch is even with chrisekelley:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Android-Coconut-TouchDB uses TouchDB-Android to provide Couchapps on Android devices.

An Android APK is available if you'd like to test this out.


Clone TouchDB-Android, which is my fork of TouchDB-Android. My fork follows closely the official version pretty closely. If you already have the couchbaselabs version, it should work fine.

Using your own Couchapp

If you use your own Couchapp, edit res/raw/ and change coconut-sample to the name of your couchapp. Note that you can also change the port in this file.


You must provide .zips of the touchdb and touchdb attachments directory.

An easy (but slow) way to do this is to deploy Android-Coconut-TouchDB to the Android Emulator and then pushing your new Couchapp to it.

Redirect the emulator to a local port. In this example, TouchDB, which runs on port 8888, is redirected to port 8880:

telnet localhost 5554 
redir add tcp:8880:8888

Ensure that you have added

 , "tou": {"db": ""}

to your .couchapprc file.

Push the new project to the emulator:

couchapp push tou

Another way of doing this:

 adb forward tcp:8990 tcp:8888   
 couchapp push . http://localhost:8990/couchabb	

Pushing to the emulator is very slow. Using couchapp -v, watching logcat, or having some coffee can help. You also may be able to push to a device instead of the emulator.

Once it is on the emulator you can download the SQLlite db to the app:

cd Android-Coconut-TouchDB/assets
adb pull /data/data/org.rti.rcd.ict.touchdb.testapp/files
cd files

Zip coconut-sample.touchdb to create
Zip coconut-sample to create

Remove the old zips and un-zipped items.

Sample Couchapp

More information about the sample couchapp is on the Cococnut-sample project page.


What else?

Take a look at Android-Coconut-MobileFuton, which is an Android runtime for Couchapps using Mobile-Couchbase and may provide a little more background on how this works.