package com.thingple.tagservice;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

import com.thingple.tagservice.device.DeviceContext;


/**
 * Device Service
 */
public class IDeviceService extends Service {

    private IBinder binder;

    public IDeviceService() {
    }

    @Override
    public IBinder onBind(Intent intent) {

        if (this.binder == null) {
            this.binder = new DeviceContext(this);
        }
        return this.binder;
    }
}

@@ -27,16 +27,56 @@
 rvice;%0A%0A
+import android.app.NotificationManager;%0A
 import a
@@ -152,16 +152,66 @@
 IBinder;
+%0Aimport android.support.v4.app.NotificationCompat;
 %0A%0Aimport
@@ -427,163 +427,1004 @@
 lic 
-IBinder onBind(Intent intent) %7B%0A%0A        if (this.binder == null) %7B%0A            this.binder = new DeviceContext(this);%0A        %7D%0A        return this.binder
+void onCreate() %7B%0A        super.onCreate();%0A%0A        NotificationManager mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);%0A        if (mNotificationManager != null) %7B%0A%0A            NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(%0A                    this);%0A            mBuilder.setContentTitle(/*getString(R.string.notification_title)*/ %22TITLE%22);%0A            mBuilder.setContentText(/*getString(R.string.notification_content)*/ %22CONTENT%22);%0A            //mBuilder.setSmallIcon(R.mipmap.ic_launcher);%0A            mNotificationManager.notify(1, mBuilder.build());%0A        %7D%0A    %7D%0A%0A    @Override%0A    public IBinder onBind(Intent intent) %7B%0A%0A        if (this.binder == null) %7B%0A            this.binder = new DeviceContext(this);%0A        %7D%0A        return this.binder;%0A    %7D%0A%0A    @Override%0A    public int onStartCommand(Intent intent, int flags, int startId) %7B%0A        flags = START_STICKY;%0A        return super.onStartCommand(intent, flags, startId)
 ;%0A  

add notification to service