ANN: TouchDB-Android

2,105 views
Skip to first unread message

Marty Schoch

unread,
Feb 18, 2012, 2:38:15 PM2/18/12
to mobile-c...@googlegroups.com
I'm happy to announce that TouchDB-Android has improved to the point
you can experiment with using it in applications. Its still a few
weeks behind the iOS version, and not nearly as robust, but we now
have a working Ektorp adapter which allows you to build TouchDB
applications with the same API as you would use with Couchbase Mobile.

An example of what this looks like can be found on the "touchdb"
branch of the GrocerySync application:

https://github.com/couchbaselabs/AndroidGrocerySync/tree/touchdb

Normally you would have initialized Ektorp using code like:

httpClient = new
AndroidHttpClient.Builder().host(host).port(port).maxConnections(100).build();
dbInstance = new StdCouchDbInstance(httpClient);

With TouchDB you use code like:

server = new TDServer(filesDir);
httpClient = new TouchDBHttpClient(server);
dbInstance = new StdCouchDbInstance(httpClient);

The only other changes your code may require is to define your views
in Java instead of relying on those in design documents. An example
of this can also be found in the Grocery Sync code.

There are still some pretty major issues, in particular the replicator
dies pretty hard when I point at the default grocery-sync database.
But I hope this release opens the door for others to get more involved
in the project.

marty

Jonathan

unread,
Feb 21, 2012, 8:51:51 AM2/21/12
to mobile-c...@googlegroups.com
I would like to start using Android TouchDB, and therefore get involved to help move it along.  Of particular interest to me is replicating with a remote CouchDB instance and handling not only loss of connectivity, but poor connectivity.

Where could I get started?  Which areas could you use the most help in at the moment?

Marty Schoch

unread,
Feb 21, 2012, 11:44:25 AM2/21/12
to mobile-c...@googlegroups.com

Hi Jonathan,

I think the first thing would be to verify that all the unit tests are
working for you. Second, I would grab the TouchDB branch of
GrocerySync and verify that this is working for you. It should
provided a decent starting point for seeing how replication behaves
when the network connectivity is lost/restored.

I know Jens recently added some behavior for this to the iOS version,
so I'd like our implementation to be similar, but obviously hook into
the Android events.

marty

bsquared

unread,
Feb 22, 2012, 12:05:26 PM2/22/12
to Mobile Couchbase
I have been looking forward to this announcement. I think TouchDB is
more inline with my goals than couchbase mobile.

Thank you.

Regards,
Brian

J Chris Anderson

unread,
Feb 22, 2012, 12:13:45 PM2/22/12
to mobile-c...@googlegroups.com

On Feb 22, 2012, at 9:05 AM, bsquared wrote:
>
> I have been looking forward to this announcement. I think TouchDB is
> more inline with my goals than couchbase mobile.
>
> Thank you.

Glad you like it. We think it is a better fit for most applications as well. Expect to see a lot more awesomeness around these projects in the next few months :)

Chris

bsquared

unread,
Feb 22, 2012, 5:33:04 PM2/22/12
to Mobile Couchbase
On Feb 18, 11:38 am, Marty Schoch <marty.sch...@gmail.com> wrote:
Works nice, no issues like I had with other. One question, I wonder
if I have something misconfigured in eclipse. I get these two
messages when I run the grocery-sync app.

[2012-02-22 14:21:08 - TouchDB-Android] Could not find TouchDB-
Android.apk!
[2012-02-22 14:21:08 - TouchDB-Android-Ektorp] Could not find TouchDB-
Android-Ektorp.apk!

I thought that a library did not create an apk file.

Thank you.

Regards,
Brian

Marty Schoch

unread,
Feb 23, 2012, 2:15:24 PM2/23/12
to mobile-c...@googlegroups.com
On Wed, Feb 22, 2012 at 2:33 PM, bsquared <bwco...@gmail.com> wrote:
> Works nice, no issues like I had with other.  One question, I wonder
> if I have something misconfigured in eclipse.  I get these two
> messages when I run the grocery-sync app.
>
> [2012-02-22 14:21:08 - TouchDB-Android] Could not find TouchDB-
> Android.apk!
> [2012-02-22 14:21:08 - TouchDB-Android-Ektorp] Could not find TouchDB-
> Android-Ektorp.apk!
>
> I thought that a library did not create an apk file.

Glad to hear its working for you. I think those messages are related
to me not setting something up correctly. I definitely see them from
time to time but started to ignore them because everything seemed to
work. Would love to know how to make them go away.

marty

Reply all
Reply to author
Forward
0 new messages