Permalink
Browse files

Added an initial empty application that starts Couchbase

Change-Id: I13b051b25c41f6aa46ef81663424d72d540aa1ab
Reviewed-on: http://review.couchbase.org/8992
Reviewed-by: Dale Harvey <daleharvey@arandomurl.com>
Tested-by: Dale Harvey <daleharvey@arandomurl.com>
  • Loading branch information...
1 parent a366076 commit 30045903829d3f31e1d8263a5a7dc463bad92551 @daleharvey daleharvey committed with Dale Harvey Aug 16, 2011
View
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry kind="lib" path="/Android-Couchbase/lib/commons-compress-1.0.jar"/>
+ <classpathentry kind="src" path="Android-Couchbase_src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
View
@@ -0,0 +1,2 @@
+bin
+gen
View
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>EmptyApp</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </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>
View
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.couchbase.emptyapp"
+ 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=".EmptyAppActivity"
+ android:label="@string/app_name">
+ <intent-filter>
+ <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>
+
+ </application>
+
+ <uses-permission android:name="android.permission.INTERNET"></uses-permission>
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
+
+</manifest>
View
@@ -1 +1,21 @@
-Coming Soon
+## Empty App
+
+EmptyApp is minimal application that can be used to verify your installation works correctly.
+
+### Install
+
+ git clone git://github.com/couchbase/Android-EmptyApp.git
+ git clone git://github.com/couchbaselabs/Android-Couchbase.git
+
+And open both (`File -> Import -> Existing Projects`) projects in eclipse
+
+You will need to ensure EmptyApp has the correct path to Android-Couchbase, right click the EmptyApp project and select `Properties -> Android` and in the bottom right make sure to add the Android-Couchbase library.
+
+Now right click the EmptyApp project and select `Run As -> Android Application`, the installation should take around a minute and in the log you should see:
+
+ V/Couchbase( 1505): Apache CouchDB has started. Time to relax.
+ V/Couchbase( 1505): [info] [<0.41.0>] Apache CouchDB has started on http://0.0.0.0:34680/
+ V/EmptyApp( 1505): Couchbase has started
+ V/Couchbase( 1505): =PROGRESS REPORT==== 16-Aug-2011::16:47:38 ===
+ V/Couchbase( 1505): application: couch
+ V/Couchbase( 1505): started_at: nonode@nohost
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -0,0 +1,12 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-7
+android.library.reference.1=../Android-Couchbase
View
@@ -0,0 +1,40 @@
+-optimizationpasses 5
+-dontusemixedcaseclassnames
+-dontskipnonpubliclibraryclasses
+-dontpreverify
+-verbose
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.app.backup.BackupAgentHelper
+-keep public class * extends android.preference.Preference
+-keep public class com.android.vending.licensing.ILicensingService
+
+-keepclasseswithmembernames class * {
+ native <methods>;
+}
+
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclassmembers class * extends android.app.Activity {
+ public void *(android.view.View);
+}
+
+-keepclassmembers enum * {
+ public static **[] values();
+ public static ** valueOf(java.lang.String);
+}
+
+-keep class * implements android.os.Parcelable {
+ public static final android.os.Parcelable$Creator *;
+}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+<TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hello"
+ />
+</LinearLayout>
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="hello">Hello World, EmptyAppActivity!</string>
+ <string name="app_name">EmptyApp</string>
+</resources>
@@ -0,0 +1,42 @@
+package com.couchbase.emptyapp;
+
+import android.app.Activity;
+import android.content.ServiceConnection;
+import android.os.Bundle;
+import android.util.Log;
+
+import com.couchbase.libcouch.CouchbaseEmbeddedServer;
+import com.couchbase.libcouch.ICouchClient;
+
+public class EmptyAppActivity extends Activity {
+
+ @SuppressWarnings("unused")
+ private ServiceConnection couchServiceConnection;
+
+ protected static final String TAG = "EmptyApp";
+
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+
+ CouchbaseEmbeddedServer couch = new CouchbaseEmbeddedServer(getBaseContext(), mCallback);
+ couchServiceConnection = couch.startCouchbase();
+ }
+
+ private final ICouchClient mCallback = new ICouchClient.Stub() {
+ @Override
+ public void couchStarted(String host, int port) {
+ Log.v(TAG, "Couchbase has started");
+ }
+
+ @Override
+ public void installing(int completed, int total) {
+ }
+
+ @Override
+ public void exit(String error) {
+ }
+ };
+}

0 comments on commit 3004590

Please sign in to comment.