Skip to content

Commit 869373a

Browse files
daleharveyDale Harvey
authored and
Dale Harvey
committed
Updated instructions for using the install helper
Change-Id: I0bbd4a5326185a979c6774db38127e835ed55bc4 Reviewed-on: http://review.couchbase.org/9169 Reviewed-by: Dale Harvey <[email protected]> Tested-by: Dale Harvey <[email protected]>
1 parent e9edd0c commit 869373a

File tree

1 file changed

+22
-26
lines changed

1 file changed

+22
-26
lines changed

README.markdown

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ What this means for you:
88
* Your Android apps can use Apache CouchDB's well-proven synchronization technology.
99
* If you <3 CouchApps, you can deploy them as Android apps.
1010

11-
### Beta Release
12-
13-
If you just want to get started, jump to **Getting Started**.
14-
15-
The biggest thing we need help with is size optimization - currently a Release build adds about 4 MB to your application (reported as 13MB).
16-
1711
## Join us
1812

1913
There is a [Google Group here for Mobile Couchbase](https://groups.google.com/group/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.
@@ -28,37 +22,29 @@ If you have questions or get stuck or just want to say hi, email <mobile@couchba
2822

2923
These instructions require you to have installed Eclipse and the Android SDK, the [Android developer website](http://developer.android.com/sdk/installing.html) has instructions.
3024

31-
## Building a new application
25+
## Downloading
3226

33-
First you need to download Android-Couchbase
27+
Clone the Android-Couchbase repository
3428

3529
git clone git://github.com/couchbase/Android-Couchbase.git
3630

3731
And ensure its opened in eclipse (`File -> Import -> Existing Projects`)
3832

39-
Then start a new Android project `File -> New Project -> Android Project` and follow the wizard.
40-
41-
You will need to add some dependancies so your project can see Android-Couchbase. Right click your project and select `Properties -> Android` and on the lower libraries panel press "Add" and select the LibCouch project.
42-
43-
Copy `assets/couchbase-$RELEASE_VERSION.tgz.jpg` from Android-Couchbase/assets into your projects assets directory
33+
## Setting up the Android-Couchbase library
4434

45-
back in the properties dialog pick Java Build Path -> Libraries and Add JARS, navigate to LibCouch/lib and choose `commons-io.2.0.1.jar`
35+
If you have not already done so, you can start a new Android project with `File -> New Project -> Android Project`.
4636

47-
Inside your AndroidManifest.xml you will need the following definitions inside the <manifest> tag
37+
Inside the Couchbase project there is a file `scripts/add-couchbase-to-project.xml`, right click on this file and `Run as -> Ant Build` you will be prompted for 2 paths, these will be stored in the `build.properties`
4838

49-
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
50-
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
51-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
39+
`Android SDK`: This is the location you installed the SDK into, the folder will look something like `android-sdk-mac_x86`, (`$ type -p android` may help you find its location, remember to strip the `/tools/android` from that path)
5240

53-
The following code is what is needed in your application to start Couchbase as a service
41+
`Project Path`: This is the path to the Root of your application, Right clicking on your project and selecting `Properties -> Resource` will show you its location.
5442

55-
as well as
43+
After you have ran this step you will need to `Refresh` your project (`F5` or `Right Click -> Refresh`)
5644

57-
<service android:name="com.couchbase.libcouch.CouchService"
58-
android:enabled="true"
59-
android:exported="false"></service>
45+
## Starting Android-Couchbase
6046

61-
inside your <application> tag, then the following code is used inside your application to start Couchbase
47+
Once Android-Couchbase has been setup the following code is used inside your application to start Couchbase
6248

6349
private final ICouchClient mCallback = new ICouchClient.Stub() {
6450
@Override
@@ -71,11 +57,21 @@ inside your <application> tag, then the following code is used inside your appli
7157
public void exit(String error) {}
7258
};
7359

74-
String release = "release-0.1";
75-
ServiceConnection couchServiceConnection = CouchDB.getService(getBaseContext(), null, release, mCallback);
60+
public void startMyApplication() {
61+
CouchbaseMobile couch = new CouchbaseMobile(getBaseContext(), mCallback);
62+
couchServiceConnection = couch.startCouchbase();
63+
}
7664

7765
For examples please look at https://github.com/couchbase/Android-EmptyApp
7866

67+
## Use Existing Application
68+
69+
If you have downloaded EmptyApp or other applications that have already been setup to use Android-Couchbase, you may need to reconfigure some options for your system, open the `build.properties` file and correct the following variables:
70+
71+
`sdk.dir`: This is the location you installed the SDK into, the folder will look something like `android-sdk-mac_x86`, (`$ type -p android` may help you find its location, remember to strip the `/tools/android` from that path)
72+
73+
`android.couchbase.dir`: This is the path to Android-Couchbase, Right clicking on the Android-Couchbase project and selecting `Properties -> Resource` will show you its location.
74+
7975
## Build information
8076

8177
The current build of Android Couchbase embed the CouchDB binaries. There is information on how to build these binaries on the [SourceBuild](https://github.com/couchbase/Android-Couchbase-SourceBuild) project.

0 commit comments

Comments
 (0)