blob: 700030c584ae6df65b068eee5bd7e0924c2e8070 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package com.orbekk.same.android.benchmark;
import android.app.Activity;
import com.orbekk.same.benchmark.ExampleServer;
import com.orbekk.same.benchmark.HttpClientBenchmark;
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);
HttpClientBenchmark.benchmark(
"http://localhost:12000/HttpExampleService.json",
100, 2000);
} 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);
}
}
}
|