diff options
author | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-04-09 12:29:46 +0200 |
---|---|---|
committer | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-04-09 12:29:46 +0200 |
commit | 5df074fb9333f23290d1d988e37dc2d821c46b0c (patch) | |
tree | c3f8f337cd55ef5c62afb452ee3e1d03749aeefa /same-android | |
parent | 3f4186ee2aef437f946fad717fb9ac133d3d3366 (diff) |
Add ExampleProtobufServerActivity.
This Activity hosts a protocol buffer server.
Diffstat (limited to 'same-android')
3 files changed, 23 insertions, 0 deletions
diff --git a/same-android/AndroidManifest.xml b/same-android/AndroidManifest.xml index 59af81a..9fdeebd 100644 --- a/same-android/AndroidManifest.xml +++ b/same-android/AndroidManifest.xml @@ -23,6 +23,7 @@ <activity android:name=".StateViewerActivity"/> <activity android:name=".GraphicsActivity"/> <activity android:name="com.orbekk.same.android.benchmark.RepeatedSetVariableActivity"/> + <activity android:name="com.orbekk.same.android.benchmark.ExampleProtobufServerActivity"/> <service android:name=".SameService" android:process="com.orbekk.same.android.SameService"/> </application> 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(); + } +} |