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

Commit

Permalink
updated to latest Couchbase-Android and added error dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
mschoch committed Aug 22, 2011
1 parent 9b23108 commit fec8fc0
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 155 deletions.
15 changes: 15 additions & 0 deletions .externalToolBuilders/CouchbaseBuilder.launch
@@ -0,0 +1,15 @@
<?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>
9 changes: 4 additions & 5 deletions .project
@@ -1,7 +1,6 @@
<?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>
Expand All @@ -25,7 +24,7 @@
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<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>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
Expand All @@ -37,4 +36,4 @@
<locationURI>_android_Android_Couchbase_77cf4961/src</locationURI>
</link>
</linkedResources>
</projectDescription>
</projectDescription>
Binary file added assets/couchbase-1.0-dp-ebc0925.tgz.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/couchbase-1.0-dp-f08f54c.tgz.jpg
Binary file not shown.
147 changes: 0 additions & 147 deletions couchbase-build.xml

This file was deleted.

1 change: 1 addition & 0 deletions couchbase-build.xml
2 changes: 2 additions & 0 deletions res/values/strings.xml
Expand Up @@ -4,4 +4,6 @@
<string name="startup_message">Starting Couchbase Mobile</string>
<string name="installing_message">Installing Couchbase Mobile</string>
<string name="add_item_hint">Add Item</string>
<string name="error_dialog_title">Couchbase Error</string>
<string name="error_dialog_button">Exit</string>
</resources>
16 changes: 13 additions & 3 deletions src/com/couchbase/grocerysync/AndroidGrocerySyncActivity.java
Expand Up @@ -36,7 +36,7 @@
import android.widget.EditText;
import android.widget.ListView;

import com.couchbase.libcouch.CouchbaseEmbeddedServer;
import com.couchbase.libcouch.CouchbaseMobile;
import com.couchbase.libcouch.ICouchClient;

public class AndroidGrocerySyncActivity extends Activity implements OnItemClickListener, OnItemLongClickListener, OnKeyListener {
Expand Down Expand Up @@ -89,7 +89,17 @@ public void installing(int completed, int total) throws RemoteException {
}

public void exit(String error) throws RemoteException {

AlertDialog.Builder builder = new AlertDialog.Builder(AndroidGrocerySyncActivity.this);
builder.setMessage(error)
.setCancelable(false)
.setPositiveButton(R.string.error_dialog_button, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
AndroidGrocerySyncActivity.this.finish();
}
})
.setTitle(R.string.error_dialog_title);
AlertDialog alert = builder.create();
alert.show();
}

public void couchStarted(String host, int port) throws RemoteException {
Expand Down Expand Up @@ -126,7 +136,7 @@ public void couchStarted(String host, int port) throws RemoteException {
};

protected void startCouch() {
CouchbaseEmbeddedServer couch = new CouchbaseEmbeddedServer(getBaseContext(), couchCallbackHandler);
CouchbaseMobile couch = new CouchbaseMobile(getBaseContext(), couchCallbackHandler);
couchServiceConnection = couch.startCouchbase();
}

Expand Down

0 comments on commit fec8fc0

Please sign in to comment.