summaryrefslogtreecommitdiff
path: root/same-android/src/main/java/com
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-04-09 12:29:46 +0200
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-04-09 12:29:46 +0200
commit5df074fb9333f23290d1d988e37dc2d821c46b0c (patch)
treec3f8f337cd55ef5c62afb452ee3e1d03749aeefa /same-android/src/main/java/com
parent3f4186ee2aef437f946fad717fb9ac133d3d3366 (diff)
Add ExampleProtobufServerActivity.
This Activity hosts a protocol buffer server.
Diffstat (limited to 'same-android/src/main/java/com')
-rw-r--r--same-android/src/main/java/com/orbekk/same/android/MainActivity.java3
-rw-r--r--same-android/src/main/java/com/orbekk/same/android/benchmark/ExampleProtobufServerActivity.java19
2 files changed, 22 insertions, 0 deletions
diff --git a/same-android/src/main/java/com/orbekk/same/android/MainActivity.java b/same-android/src/main/java/com/orbekk/same/android/MainActivity.java
index 87ec967..4714b37 100644
--- a/same-android/src/main/java/com/orbekk/same/android/MainActivity.java
+++ b/same-android/src/main/java/com/orbekk/same/android/MainActivity.java
@@ -17,6 +17,7 @@ import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.orbekk.same.android.R;
+import com.orbekk.same.android.benchmark.ExampleProtobufServerActivity;
import com.orbekk.same.android.benchmark.RepeatedSetVariableActivity;
public class MainActivity extends Activity {
@@ -30,6 +31,8 @@ public class MainActivity extends Activity {
activities.put("State monitor", StateViewerActivity.class);
activities.put("Graphics demo", GraphicsActivity.class);
activities.put("Benchmark", RepeatedSetVariableActivity.class);
+ activities.put("ExampleProtobufServer (temp)",
+ ExampleProtobufServerActivity.class);
}
public final static List<String> activityList =
diff --git a/same-android/src/main/java/com/orbekk/same/android/benchmark/ExampleProtobufServerActivity.java b/same-android/src/main/java/com/orbekk/same/android/benchmark/ExampleProtobufServerActivity.java
new file mode 100644
index 0000000..c6be5a4
--- /dev/null
+++ b/same-android/src/main/java/com/orbekk/same/android/benchmark/ExampleProtobufServerActivity.java
@@ -0,0 +1,19 @@
+package com.orbekk.same.android.benchmark;
+
+import android.app.Activity;
+
+import com.orbekk.same.benchmark.ExampleServer;
+
+public class ExampleProtobufServerActivity extends Activity {
+ public final ExampleServer server = new ExampleServer();
+
+ @Override public void onResume() {
+ super.onResume();
+ server.runServer(12000);
+ }
+
+ @Override public void onStop() {
+ super.onStop();
+ server.stopServer();
+ }
+}