summaryrefslogtreecommitdiff
path: root/same-android/src/main/java/com/orbekk/HelloAndroidActivity.java
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-01-17 16:48:09 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-01-17 16:48:09 +0100
commit83213691c461d502809ecd8e7700747b511a7476 (patch)
tree3c316e87e4e9fdc3f72e0bc8ef8fd9929d91aa37 /same-android/src/main/java/com/orbekk/HelloAndroidActivity.java
parentce8168592043dc51227dfac158d21a45f75e7e9d (diff)
Update android client.
– Use the SameClient code from same. – Update dependency. – Remove PingServer.
Diffstat (limited to 'same-android/src/main/java/com/orbekk/HelloAndroidActivity.java')
-rw-r--r--same-android/src/main/java/com/orbekk/HelloAndroidActivity.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/same-android/src/main/java/com/orbekk/HelloAndroidActivity.java b/same-android/src/main/java/com/orbekk/HelloAndroidActivity.java
index 4160bf4..653a870 100644
--- a/same-android/src/main/java/com/orbekk/HelloAndroidActivity.java
+++ b/same-android/src/main/java/com/orbekk/HelloAndroidActivity.java
@@ -1,6 +1,7 @@
package com.orbekk;
import com.orbekk.net.Broadcaster;
+import com.orbekk.same.ClientApp;
import android.app.Activity;
import android.os.Bundle;
@@ -9,8 +10,7 @@ import android.util.Log;
public class HelloAndroidActivity extends Activity {
private static String TAG = "master";
- private PingServer pingServer;
-
+
/**
* Called when the activity is first created.
* @param savedInstanceState If the activity is being re-initialized after
@@ -27,22 +27,18 @@ public class HelloAndroidActivity extends Activity {
Log.i(TAG, "onCreate");
setContentView(R.layout.main);
- pingServer = PingServer.createPingServer(10080);
- try {
- pingServer.start();
- } catch (Exception e) {
- throw new RuntimeException(e.getMessage());
- }
// Broadcast broadcast = new Broadcast(this);
// broadcast.sendBroadcast("Broadcast test".getBytes(), 10010);
Broadcaster broadcaster = new Broadcaster();
Log.i(TAG, "Broadcast success: " + broadcaster.sendBroadcast(10010, "Broadcast test from Android".getBytes()));
+
+ ClientApp client = new ClientApp();
+ client.run(10015, "ClientNetwork", "http://10.0.0.6:10010/");
}
@Override
protected void onDestroy() {
- pingServer.stop();
super.onDestroy();
}
}