/** * @see android.app.Service#onCreate() */ @Override public void onCreate() { super.onCreate(); // create a binder that will let the Activity UI send // commands to the Service mqttServiceBinder = new MqttServiceBinder(this); // create somewhere to buffer received messages until // we know that they have been passed to the application messageStore = new DatabaseMessageStore(this, this); }
@Override public void onServiceConnected(ComponentName name, IBinder binder) { mqttService = ((MqttServiceBinder) binder).getService(); bindedService = true; // now that we have the service available, we can actually // connect... doConnect(); }
/** * @see android.app.Service#onBind(Intent) */ @Override public IBinder onBind(Intent intent) { // What we pass back to the Activity on binding - // a reference to ourself, and the activityToken // we were given when started String activityToken = intent .getStringExtra(MqttServiceConstants.CALLBACK_ACTIVITY_TOKEN); mqttServiceBinder.setActivityToken(activityToken); return mqttServiceBinder; }
@Override public void onServiceConnected(ComponentName name, IBinder binder) { mqttService = ((MqttServiceBinder) binder).getService(); bindedService = true; // now that we have the service available, we can actually // connect... doConnect(); }
/** * @see android.app.Service#onBind(Intent) */ @Override public IBinder onBind(Intent intent) { // What we pass back to the Activity on binding - // a reference to ourself, and the activityToken // we were given when started String activityToken = intent .getStringExtra(MqttServiceConstants.CALLBACK_ACTIVITY_TOKEN); mqttServiceBinder.setActivityToken(activityToken); return mqttServiceBinder; }
/** * @see Service#onCreate() */ @Override public void onCreate() { super.onCreate(); // create a binder that will let the Activity UI send // commands to the Service mqttServiceBinder = new MqttServiceBinder(this); // create somewhere to buffer received messages until // we know that they have been passed to the application messageStore = new DatabaseMessageStore(this, this); }
@Override public void onServiceConnected(ComponentName name, IBinder binder) { mqttService = ((MqttServiceBinder) binder).getService(); bindedService = true; // now that we have the service available, we can actually // connect... doConnect(); }
/** * @see Service#onBind(Intent) */ @Override public IBinder onBind(Intent intent) { // What we pass back to the Activity on binding - // a reference to ourself, and the activityToken // we were given when started String activityToken = intent .getStringExtra(MqttServiceConstants.CALLBACK_ACTIVITY_TOKEN); mqttServiceBinder.setActivityToken(activityToken); return mqttServiceBinder; }
/** * @see android.app.Service#onCreate() */ @Override public void onCreate() { super.onCreate(); // create a binder that will let the Activity UI send // commands to the Service mqttServiceBinder = new MqttServiceBinder(this); // create somewhere to buffer received messages until // we know that they have been passed to the application messageStore = new DatabaseMessageStore(this, this); }