Skip to content

null2/couchbase-lite-android

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Couchbase-Lite-Android

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

Getting Started with Couchbase Lite

Developing / Contributing to Couchbase Lite

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.

Prerequisites

  • Download Android Studio

  • 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)

Clone the repository

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

Configure Android Studio SDK location

  • cp local.properties.example local.properties
  • Customize local.properties according to your SDK installation directory

Importing Project into Android Studio

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

Working around Import bugs

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.

Running tests

See the Running the Test Suite wiki page.

Building and deploying maven artifacts.

If you want to host and deploy your own maven artifacts, see the upload_android_artifacts.sh script.

Example Apps

Utilities

Current Status

  • Alpha / Developer Preview

Requirements

  • Android 2.3 Gingerbread (API level 9) and above.

License

  • Apache License 2.0

githalytics.com alpha

About

Lightweight, embedded, syncable NoSQL database engine for Android.

Resources

License

Stars

Watchers

Forks

Packages

No packages published