GithubHelp home page GithubHelp logo

android-couchbase's Introduction

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.

Beta Release

If you just want to get started, jump to Getting Started.

The biggest thing we need help with is size optimization - currently a Release build adds about 4 MB to your application (reported as 13MB).

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.

Getting Started

If you have questions or get stuck or just want to say hi, email [email protected] 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.

Running the Demo app

Get the main repository

git clone --recursive git://github.com/couchbaselabs/Android-Couchbase.git

Import both the libcouch-android and Android-Demo projects into your workbench with File -> Import -> General -> Existing Projects into Workspace and browse to the location you checked out Android-Couchbase into.

You will need to do a clean build, Project -> Clean and choose both libcouch-android CouchApp

You should now be able to run CouchApp by right clicking on the CouchApp project and choosing Run As -> Android Application

Building a new application

Start a new Android project, right click your new project -> Properties -> Android and on the lower libraries panel press "Add" and select the LibCouch project

Copy assets/release-0.1.tgz.jpg from LibCouch/assets into your projects assets directory

back in the properties dialog pick Java Build Path -> Libraries and Add JARS, navigate to LibCouch/lib and choose both commons-compress-1.0.jar and commons-io.2.0.1.jar

Inside your AndroidManifest.xml you will need the following definitions inside the tag

<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>

The following code is what is needed in your application to start Couchbase as a service

as well as

<service android:name="com.couchbase.libcouch.CouchService"
         android:enabled="true"
         android:exported="false"></service>

inside your tag, then the following code is used inside your application to start Couchbase

private final ICouchClient mCallback = new ICouchClient.Stub() {
  @Override
  public void couchStarted(String host, int port) {}

  @Override
  public void installing(int completed, int total) {}

  @Override
  public void exit(String error) {}
};

String release = "release-0.1";
ServiceConnection couchServiceConnection = CouchDB.getService(getBaseContext(), null, release, mCallback);

for example of all of these you can check inside the Android-Demo folder

Build information

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

License

Portions under Apache, Erlang, and other licenses.

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

Copyright 2011, Couchbase, Inc.

android-couchbase's People

Contributors

daleharvey avatar

Stargazers

Arvind Subramanian avatar

Watchers

Arvind Subramanian avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.