summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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