Prerequisites:
Android SDK
Eclipse ADT
Instructions:
1. Create a new Android project or select an existing project.
2. Download Couchbase.zip and couchbase.xml into the top-level of the project:
https://github.com/downloads/mschoch/Android-Couchbase/Couchbase.zip
https://github.com/downloads/mschoch/Android-Couchbase/couchbase.xml
3. Right-click on couchbase.xml and select Run As > Ant Build
4. Refresh your project
You can now add Couchbase to your project using code like:
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) {}
};
public void startMyApplication() {
CouchbaseMobile couch = new CouchbaseMobile(getBaseContext(), mCallback);
couchServiceConnection = couch.startCouchbase();
}
We think this is the easiest way to get Mobile Couchbase into your
Android project yet. But we want to hear your feedback!
marty
Certainly we can do a better job of error reporting when the zip file
didn't contain what we expected.
I'm not opposed to adding the sha to the filename, but I was hoping to
keep the couchbase.xml generic enough that on upgrade the user only
has to replace the zip file. Chris had even thrown out the idea that
the script could (when asked) check the web to see if there was a
newer zip package available. We might be able to roll all this
together.
marty
Getting a particular couchapp started may go beyond the basic getting
started instructions though, as you'll most likely have other
decisions to make, such as whether you'll be using Ektorp or not. But
yes, there should be a document describing how to do this.
marty
http://www.couchbase.org/get/couchbase-mobile-for-ios/current
Chris
** System being used **
Mac OS X version 10.6.8. Eclipse 3.6.1.
** Steps to reproduce problem **
Install the server following the instructions on the web site. This worked fine. I am able to open the membase web console at: http://127.0.0.1:8091/index.html#sec=analytics&statsBucket=/pools/default/buckets/default
Download the developer preview from:
http://www.couchbase.org/get/couchbase-mobile-for-android/current
Follow the instructions for installing both the LibCouch and the CouchBase Eclipse projects.
Both projects compile fine in Eclipse.
Install the Android app to the phone which is running Android 2.2.
I see the progress bar and it shows that the DB is installing.
Then, I see the following error:
08-29 08:44:00.777: ERROR/AndroidRuntime(21797): Caused by: java.lang.UnsatisfiedLinkError: Library com_google_ase_Exec not found
Target couchbase-internal.update-libaries does not exist in this project couchbase.xml /CouchApp line 9 Ant Buildfile Problem
gf
We'll definitely help get you up and running.
Although highly confusing, it's actually normal to see the message
"Target couchbase-internal.update-libaries does not exist in this
project " if you open the couchbase.xml file. This has to do with us
referencing a target that is included at runtime and not visible to
eclipse. However, if you right click on that file and select Run As >
Ant Build it should run successfully.
Can you give that a try?
marty
BUILD FAILED
/Users/[omitted]/Development/workspace/CouchApp/couchbase.xml:3: Problem: failed to create task or type include
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
Total time: 46 milliseconds
gf
ant -version
That said, we have an updated version of the zip/script package that I
hope will be posted today. One of the changes in this script is we
changed from using "include" to "import". Hopefully your version of
ant understands the import task (though we may find other issues, I
have not tested with anything less than 1.8)
Once the files are online we'll post a message to this group. Your
assistance in testing these scripts will be a big help to the
community.
Also, it would be great if you could let us know your Eclipse version
as well as your Ant version. We'll at least want to document which
versions we know work.
Thanks,
marty
I'll take a look at how much effort there is in supporting Ant 1.7.x.
marty
For the final deployment of applications, its recommended you follow these instructions to build a standalone application that includes the code to your couchapp, that way your uses dont need to do any bookmarking or replication, and you dont need to worry about my app dissapearing (or more likely being updated in incompatible ways)
As Chris said in his announcement, the latest packages and
instructions can be found here:
http://www.couchbase.org/get/couchbase-mobile-for-android/current
Thanks again to everyone testing these packages.
marty