summaryrefslogtreecommitdiff
path: root/same-android/src/main/java/com/orbekk/same/SameService.java
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-14 13:22:54 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-14 13:22:54 +0100
commitebf3d3451e1a04e4f8b0c762fe6c0297884983e5 (patch)
tree5d480dcf4151f846d12e43293685cfa7b341fb68 /same-android/src/main/java/com/orbekk/same/SameService.java
parent990f1cfeb54d7ef83a1ee465c95f53ce803c1b13 (diff)
same-android: Implement network joining.
Diffstat (limited to 'same-android/src/main/java/com/orbekk/same/SameService.java')
-rw-r--r--same-android/src/main/java/com/orbekk/same/SameService.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/same-android/src/main/java/com/orbekk/same/SameService.java b/same-android/src/main/java/com/orbekk/same/SameService.java
index 3237e61..a960065 100644
--- a/same-android/src/main/java/com/orbekk/same/SameService.java
+++ b/same-android/src/main/java/com/orbekk/same/SameService.java
@@ -24,11 +24,14 @@ public class SameService extends Service {
public final static int DISPLAY_MESSAGE = 1;
public final static int SEARCH_NETWORKS = 2;
public final static int CREATE_NETWORK = 3;
+ public final static int JOIN_NETWORK = 4;
public final static String AVAILABLE_NETWORKS_UPDATE =
"com.orbekk.same.SameService.action.AVAILABLE_NETWORKS_UPDATE";
public final static String AVAILABLE_NETWORKS =
"com.orbekk.same.SameService.action.AVAILABLE_NETWORKS";
+ public final static String NETWORK_URLS =
+ "com.orbekk.same.SameService.action.NETWORK_URLS";
final static int SERVICE_PORT = 15068;
final static int DISCOVERY_PORT = 15066;
@@ -50,6 +53,8 @@ public class SameService extends Service {
Intent intent = new Intent(AVAILABLE_NETWORKS_UPDATE);
intent.putStringArrayListExtra(AVAILABLE_NETWORKS,
networkNames);
+ intent.putStringArrayListExtra(NETWORK_URLS,
+ networkUrls);
sendBroadcast(intent);
}
};
@@ -70,6 +75,10 @@ public class SameService extends Service {
logger.info("CREATE_NETWORK");
create();
break;
+ case JOIN_NETWORK:
+ logger.info("JOIN_NETWORK");
+ String masterUrl = (String)message.obj;
+ sameController.getClient().joinNetwork(masterUrl);
default:
super.handleMessage(message);
}