LiteServ is an HTTP (ReST) interface to the Couchbase-Lite database running on the device/emulator.
Here's how it fits into the picture:
LiteServ effectively wraps Couchbase Lite and provides an API that can be accessed via HTTP.
It is useful for:
- Using Couchbase-Lite inside of a LiteGap app (eg, a Couchbase-Lite app based on PhoneGap)
- Easy access to data in a Couchbase-Lite database via curl for debugging
- Doing pull replications where something else is pulling data from Couchbase-Lite
git clone https://github.com/couchbaselabs/couchbase-lite-android-liteserv.git cd couchbase-lite-android-liteserv git submodule init && git submodule update
Import Project into Android Studio
Note: this project is known to work on Android Studio 0.4.3 and earlier 0.4.X versions, but is not working on Android Studio 0.4.4 or later due to this Android Studio bug
Follow the instructions in the following sections of the Couchbase Lite Android README on Importing Project into Android Studio:
Building and deploying maven artifacts.
If you want to host and deploy your own maven artifacts, see the
Building LiteServAndroid via Gradle command line
Configure Android Studio SDK location
cp local.properties.example local.properties
local.propertiesaccording to your SDK installation directory
$ ./gradlew clean && ./gradlew assemble
Running Unit tests
Running LiteServAndroid via Android Studio
Once the project is imported, just run the green arrow "play" button.
Running LiteServAndroid via Gradle command line
Define an AVD (android virtual device) if you have not already done so. This can be done by running
$ android avdto launch the UI
Launch the emulator with that AVD. This can be done in the AVD manager UI, or on the command line via
$ emulator64-arm -avd <avd_name> -netspeed full -netdelay nonewhere
avd_nameis the name of the AVD you created in the previous step.
$ ./run_android_liteserv.sh 8080to run it on port 8080. This should install the app into the emulator and launch it, and then setup a port forwarding rule so that 8080 on your workstation is mapped to port 8080 on the emulator.
- Android Studio & JDK 1.8.x & Mac OSX => Unable to build application because of webserver-2.-3.jar from http://files.couchbase.com/maven2/com/couchbase/cblite/webserver/2-3/ which is integrated in couchbase-lite-java-listner. Use JDK 1.7.x instead of JDK 1.8.x