aboutsummaryrefslogtreecommitdiffstats
path: root/src/de/gultsch/chat/services
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-01-24 02:04:05 +0100
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-01-24 02:04:05 +0100
commit35f8ab58f4b6f97f02031b056d2a5f6f993672cf (patch)
treef3b9cda64e6e08337a44588a564d5194fe8b3225 /src/de/gultsch/chat/services
inital commit
Diffstat (limited to 'src/de/gultsch/chat/services')
-rw-r--r--src/de/gultsch/chat/services/XmppConnectionService.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/de/gultsch/chat/services/XmppConnectionService.java b/src/de/gultsch/chat/services/XmppConnectionService.java
new file mode 100644
index 00000000..4477513d
--- /dev/null
+++ b/src/de/gultsch/chat/services/XmppConnectionService.java
@@ -0,0 +1,29 @@
+package de.gultsch.chat.services;
+
+import android.app.Service;
+import android.content.Intent;
+import android.os.Binder;
+import android.os.IBinder;
+
+public class XmppConnectionService extends Service {
+
+ // Binder given to clients
+ private final IBinder mBinder = new XmppConnectionBinder();
+
+ /**
+ * Class used for the client Binder. Because we know this service always
+ * runs in the same process as its clients, we don't need to deal with IPC.
+ */
+ public class XmppConnectionBinder extends Binder {
+ XmppConnectionService getService() {
+ // Return this instance of LocalService so clients can call public methods
+ return XmppConnectionService.this;
+ }
+ }
+
+ @Override
+ public IBinder onBind(Intent intent) {
+ return mBinder;
+ }
+
+}