summaryrefslogtreecommitdiff
path: root/same-android/src/main/java/com
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-03-06 15:10:13 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-03-06 15:10:13 +0100
commit736507d9cffc567afef96cdeaf9ab998c037cd39 (patch)
tree5a89b9962a26d510a033136530351301575d7283 /same-android/src/main/java/com
parent87235f7b860d0281e6e87f58ca965c661e67aa1b (diff)
Register local server with directory service.
Diffstat (limited to 'same-android/src/main/java/com')
-rw-r--r--same-android/src/main/java/com/orbekk/same/android/SameService.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/same-android/src/main/java/com/orbekk/same/android/SameService.java b/same-android/src/main/java/com/orbekk/same/android/SameService.java
index 9ed9ff1..3eda862 100644
--- a/same-android/src/main/java/com/orbekk/same/android/SameService.java
+++ b/same-android/src/main/java/com/orbekk/same/android/SameService.java
@@ -15,6 +15,7 @@ import android.os.IBinder;
import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
+import android.widget.Toast;
import com.orbekk.same.NetworkNotificationListener;
import com.orbekk.same.SameController;
@@ -243,6 +244,16 @@ public class SameService extends Service {
private void create() {
sameController.getClient().joinNetwork(
configuration.get("masterUrl"));
+ try {
+ sameController.getDirectory().registerNetwork(
+ configuration.get("networkName"),
+ configuration.get("masterUrl"));
+ } catch (Exception e) {
+ Toast.makeText(this, "Unable to register network. " +
+ "Use manual address to join.",
+ Toast.LENGTH_LONG).show();
+ logger.warn("Unable to advertise network.", e);
+ }
}
@Override