Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Using the plugin with Eclipse

Chris Anderson edited this page Feb 18, 2014 · 1 revision

Thanks to Barthélémy Arribe for writing this up. It is current as of Feb 2014

Cordova basic application

  • We need to install node.js
  • In your favorite terminal, to create a basic Cordova app in Eclipse:
npm install -g cordova
npm install -g plugman
cordova create helloWorldCordova
cd helloWorldCordova /
cordova -d platform add android
cordova build
  • After that, go to eclipse and import the project just created using “new Android project from existing code”. You have now a basic Cordova app working.

Couchbase Lite with cordova

If you don’t have cordova, follow the 4 first steps of the previous part. We are going to use again the terminal, creating a new project, adding different plugins, the source code and changing one library.

  • Go to the terminal
cordova create todo-lite com.couchbase.TodoLite TodoLite
cd todo-lite
  • Adding the plugins
cordova plugin add https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin.git
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
cordova plugin add https://github.com/apache/cordova-plugin-inappbrowser.git
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information.git
  • Adding the source code
rd /s /q www
git clone https://github.com/couchbaselabs/TodoLite-PhoneGap.git www
  • For android platform
cordova -d platform add android
cordova build
  • Go to eclipse and import the project just created using “new Android project from existing code”.

  • If you run it like this, an error should appear with the library “td_collator_so.jar” using some native code. To fix the problem, follow these steps that you can find on the mobile couchbase documentation starting with eclipse.

  • Download http://cl.ly/Pr1r/td_collator_so.jar.

  • Rename the downloaded td_collator_so.jar file to td_collator_so.zip.

  • Decompress the td_collator_so.zip file.

  • Copy the 3 folders in the libs folder in your project and delete the td_collator_so.jar.

  • Your app should run now

Some links which can help:

Clone this wiki locally