Permalink
Browse files

upgraded to latest Android-Couchbase installation mechanism

moved all libraries to libs/ folder
upgraded jackson library to match ektorp version
  • Loading branch information...
1 parent fec8fc0 commit d3b2b1e7e639fba8917394c8f64416aa282ea4a1 @mschoch mschoch committed Aug 29, 2011
View
@@ -3,14 +3,14 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry exported="true" kind="lib" path="assets/org.ektorp-1.1.1.jar"/>
- <classpathentry exported="true" kind="lib" path="assets/jackson-core-asl-1.7.9.jar"/>
- <classpathentry exported="true" kind="lib" path="assets/jackson-mapper-asl-1.7.9.jar"/>
- <classpathentry exported="true" kind="lib" path="assets/httpclient-4.1.2.jar"/>
- <classpathentry exported="true" kind="lib" path="assets/slf4j-api-1.6.1.jar"/>
- <classpathentry exported="true" kind="lib" path="assets/slf4j-jdk14-1.6.1.jar"/>
- <classpathentry kind="lib" path="/Android-Couchbase/lib/commons-compress-1.0.jar"/>
- <classpathentry exported="true" kind="lib" path="assets/commons-io-2.0.1.jar"/>
- <classpathentry kind="src" path="Android-Couchbase_src"/>
+ <classpathentry kind="lib" path="libs/commons-compress-1.0.jar"/>
+ <classpathentry kind="lib" path="libs/couchbase.jar"/>
+ <classpathentry kind="lib" path="libs/jackson-core-asl-1.8.5.jar"/>
+ <classpathentry kind="lib" path="libs/jackson-mapper-asl-1.8.5.jar"/>
+ <classpathentry kind="lib" path="libs/commons-io-2.0.1.jar"/>
+ <classpathentry kind="lib" path="libs/org.ektorp-1.2.1.jar"/>
+ <classpathentry kind="lib" path="libs/org.ektorp.android-1.2.1.jar"/>
+ <classpathentry kind="lib" path="libs/slf4j-api-1.6.1.jar"/>
+ <classpathentry kind="lib" path="libs/slf4j-jdk14-1.6.1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
-<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
-<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
-<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
-<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
-<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="AndroidGrocerySync"/>
-<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/AndroidGrocerySync/couchbase-build.xml}"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-d -v"/>
-<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/AndroidGrocerySync}"/>
-</launchConfiguration>
View
@@ -1,6 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?><projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
<name>AndroidGrocerySync</name>
- <comment/>
+ <comment></comment>
<projects>
</projects>
<buildSpec>
@@ -24,16 +25,9 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand><name>org.eclipse.ui.externaltools.ExternalToolBuilder</name><triggers>full,incremental,</triggers><arguments><dictionary><key>LaunchConfigHandle</key><value>&lt;project&gt;/.externalToolBuilders/CouchbaseBuilder.launch</value></dictionary></arguments></buildCommand></buildSpec>
+ </buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
- <linkedResources>
- <link>
- <name>Android-Couchbase_src</name>
- <type>2</type>
- <locationURI>_android_Android_Couchbase_77cf4961/src</locationURI>
- </link>
- </linkedResources>
-</projectDescription>
+</projectDescription>
View
@@ -1,23 +1,15 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.couchbase.grocerysync"
- android:versionCode="1"
- android:versionName="1.0">
- <uses-sdk android:minSdkVersion="7" />
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
- <uses-permission android:name="android.permission.INTERNET"></uses-permission>
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
+<?xml version="1.0" encoding="UTF-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.couchbase.grocerysync" android:versionCode="1" android:versionName="1.0">
+ <uses-sdk android:minSdkVersion="7"/>
<application android:icon="@drawable/icon" android:label="@string/app_name">
- <activity android:name=".AndroidGrocerySyncActivity"
- android:label="@string/app_name" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar" android:configChanges="keyboardHidden|orientation">
+ <activity android:name=".AndroidGrocerySyncActivity" android:label="@string/app_name" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar" android:configChanges="keyboardHidden|orientation">
<intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
- <service android:name="com.couchbase.libcouch.CouchService" android:enabled="true" android:exported="false"></service>
- <activity android:name="GrocerySyncPreferencesActivity" android:configChanges="keyboardHidden|orientation"></activity>
- </application>
-</manifest>
+ <activity android:name="GrocerySyncPreferencesActivity" android:configChanges="keyboardHidden|orientation"/>
+
+ <service android:name="com.couchbase.android.CouchbaseService" android:enabled="true" android:exported="false"/></application>
+<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/><uses-permission android:name="android.permission.INTERNET"/><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/></manifest>
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
View
View
@@ -0,0 +1,14 @@
+<project name="couchbase" default="manual">
+
+ <include>
+ <javaresource name="Couchbase/script/couchbase-internal.xml">
+ <classpath location="Couchbase.zip"/>
+ </javaresource>
+ </include>
+
+ <target name="manual" depends="couchbase-internal.update-libaries,couchbase-internal.update-assets,couchbase-internal.update-classpath,couchbase-internal.suggest-manifest">
+
+ </target>
+
+
+</project>
View
@@ -9,4 +9,3 @@
# Project target.
target=android-7
-android.library.reference.1=../../Documents/research/repo/Android-Couchbase/Android-Couchbase
Binary file not shown.
Binary file not shown.
File renamed without changes.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
@@ -11,8 +11,8 @@
import org.ektorp.CouchDbConnector;
import org.ektorp.CouchDbInstance;
import org.ektorp.ReplicationCommand;
+import org.ektorp.http.AndroidHttpClient;
import org.ektorp.http.HttpClient;
-import org.ektorp.http.StdHttpClient;
import org.ektorp.impl.StdCouchDbInstance;
import android.app.Activity;
@@ -36,8 +36,8 @@
import android.widget.EditText;
import android.widget.ListView;
-import com.couchbase.libcouch.CouchbaseMobile;
-import com.couchbase.libcouch.ICouchClient;
+import com.couchbase.android.ICouchbaseDelegate;
+import com.couchbase.android.CouchbaseMobile;
public class AndroidGrocerySyncActivity extends Activity implements OnItemClickListener, OnItemLongClickListener, OnKeyListener {
@@ -82,7 +82,7 @@ protected void onDestroy() {
}
}
- protected ICouchClient couchCallbackHandler = new ICouchClient.Stub() {
+ protected ICouchbaseDelegate couchCallbackHandler = new ICouchbaseDelegate.Stub() {
public void installing(int completed, int total) throws RemoteException {
AndroidGrocerySyncActivity.this.splashDialog.updateSplashScreenProgress(completed, total);
@@ -102,10 +102,10 @@ public void onClick(DialogInterface dialog, int id) {
alert.show();
}
- public void couchStarted(String host, int port) throws RemoteException {
+ public void couchbaseStarted(String host, int port) throws RemoteException {
AndroidGrocerySyncActivity.this.removeSplashScreen();
- HttpClient httpClient = new StdHttpClient.Builder().host(host).port(port).build();
+ HttpClient httpClient = new AndroidHttpClient.Builder().host(host).port(port).build();
CouchDbInstance dbInstance = new StdCouchDbInstance(httpClient);
couchDbConnector = dbInstance.createConnector(DATABASE_NAME, true);
@@ -1,6 +1,5 @@
package com.couchbase.grocerysync;
-import org.codehaus.jackson.JsonNode;
import org.ektorp.CouchDbConnector;
import org.ektorp.changes.ChangesCommand;
import org.ektorp.changes.ChangesFeed;
@@ -12,10 +11,10 @@
private CouchListAdapter parent;
private CouchDbConnector couchDbConnector;
- private Integer since;
+ private Long since;
private ChangesFeed feed;
- public CouchChangesAsyncTask(CouchListAdapter parent, CouchDbConnector couchDbConnector, Integer since) {
+ public CouchChangesAsyncTask(CouchListAdapter parent, CouchDbConnector couchDbConnector, Long since) {
this.parent = parent;
this.couchDbConnector = couchDbConnector;
this.since = since;
@@ -2,7 +2,6 @@
import java.util.HashMap;
import java.util.Iterator;
-import java.util.List;
import org.codehaus.jackson.JsonNode;
import org.ektorp.CouchDbConnector;
@@ -22,7 +21,6 @@
public class CouchListAdapter extends BaseAdapter {
protected Context context;
- //protected List<Row> rows;
public HashMap<String, JsonNode> rowMap;
public CouchListAdapter(Context context, CouchDbConnector couchDbConnector) {
@@ -31,10 +29,9 @@ public CouchListAdapter(Context context, CouchDbConnector couchDbConnector) {
rowMap = new HashMap<String, JsonNode>();
DbInfo dbInfo = couchDbConnector.getDbInfo();
- int lastUpdateSeq = dbInfo.getUpdateSeq();
+ long lastUpdateSeq = dbInfo.getUpdateSeq();
ViewResult vr = couchDbConnector.queryView(new ViewQuery().allDocs().includeDocs(true));
-// rows = vr.getRows();
Iterator<Row> rowIterator = vr.iterator();
while(rowIterator.hasNext()) {
Row row = rowIterator.next();
@@ -48,13 +45,11 @@ public CouchListAdapter(Context context, CouchDbConnector couchDbConnector) {
@Override
public int getCount() {
-// return rows.size();
return rowMap.size();
}
@Override
public Object getItem(int position) {
-// return rows.get(position);
String key = (String)rowMap.keySet().toArray()[position];
return rowMap.get(key);
}
@@ -72,9 +67,7 @@ public View getView(int position, View itemView, ViewGroup parent) {
v = vi.inflate(R.layout.grocery_list_item, null);
}
-// Row row = (Row)rows.get(position);
TextView label = (TextView) v.findViewById(R.id.label);
-// JsonNode document = row.getDocAsNode();
JsonNode document = (JsonNode)getItem(position);
JsonNode textNode = document.get("text");
if(textNode != null) {

0 comments on commit d3b2b1e

Please sign in to comment.