diff options
author | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-01-27 15:00:01 +0100 |
---|---|---|
committer | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-01-27 15:00:01 +0100 |
commit | fe19c8b73039d27676a7f8f80ed3bb0dfa9e2278 (patch) | |
tree | a6e3d3e46cc39086d486b996fa2f5353f028542c | |
parent | a1abc25b91760fce29c0bd94f60e1ee592a151cc (diff) |
Clean up SameService.
– Only send broadcasts.
– Don't start Same components without SameController.
-rw-r--r-- | same-android/src/main/java/com/orbekk/discovery/SameService.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/same-android/src/main/java/com/orbekk/discovery/SameService.java b/same-android/src/main/java/com/orbekk/discovery/SameService.java index 68a6c0b..19df9e3 100644 --- a/same-android/src/main/java/com/orbekk/discovery/SameService.java +++ b/same-android/src/main/java/com/orbekk/discovery/SameService.java @@ -60,21 +60,17 @@ public class SameService extends Service { discoveryThread.start(); } } - new Thread() { - @Override public void run() { - new MasterApp().run(PORT+1); - } - }.start(); } private void sendBroadcastDiscovery() { - byte[] data = "Discover".getBytes(); + String message = "Discover " + (PORT + 2); + byte[] data = message.getBytes(); new Broadcaster(this).sendBroadcast(data, PORT); } private void joinNetwork() { sendBroadcastDiscovery(); - new ClientApp().run(PORT+2, "ClientNetwork", null); + // new ClientApp().run(PORT+2, "ClientNetwork", null); } @Override |