diff options
Diffstat (limited to 'same-android/src/main/java/com/orbekk/same/android/benchmark/ExampleHttpServerActivity.java')
-rw-r--r-- | same-android/src/main/java/com/orbekk/same/android/benchmark/ExampleHttpServerActivity.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/same-android/src/main/java/com/orbekk/same/android/benchmark/ExampleHttpServerActivity.java b/same-android/src/main/java/com/orbekk/same/android/benchmark/ExampleHttpServerActivity.java new file mode 100644 index 0000000..695988d --- /dev/null +++ b/same-android/src/main/java/com/orbekk/same/android/benchmark/ExampleHttpServerActivity.java @@ -0,0 +1,30 @@ +package com.orbekk.same.android.benchmark; + +import android.app.Activity; + +import com.orbekk.same.benchmark.ExampleServer; +import com.orbekk.same.benchmark.HttpExampleServer; + +public class ExampleHttpServerActivity extends Activity { + public final HttpExampleServer server = new HttpExampleServer(); + + @Override public void onResume() { + super.onResume(); + try { + server.runServer(12000); + } catch (Exception e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + } + + @Override public void onStop() { + super.onStop(); + try { + server.stopServer(); + } catch (Exception e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + } +} |