Name: android-inuits-mqttlib
Owner: Inuits
Description: Android library for working with Paho Android Client via Intents
Created: 2017-10-18 10:22:02.0
Updated: 2017-12-02 17:34:55.0
Pushed: 2017-12-05 15:11:52.0
Homepage: null
Size: 104
Language: Java
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This repository should wrap PAHO ECLIPSE ANDROID SERVICE library. Its main intended use is to expose librari api via intent calls.
is subclass of IntentService and translates intent calls into PAHO Service library.
The services returns all messages also via intents:
nt intent = new Intent(Constants.MESSAGE_RECEIVED);
nt.putExtra(Constants.MESSAGE_TOPIC, topic);
nt.putExtra(Constants.MESSAGE_DATA, payload);
Broadcast(intent);
is simple wrapper to call intents. But you can also call the Intents by yourself.
nt mqttServiceIntent = null;
ServiceIntent = new Intent(this.context, InuitsMqttService.class);
ServiceIntent.putExtra(Constants.ACTION,Constants.ACTION_CONNECT);
ServiceIntent.putExtra(Constants.DATA_SERVER_URI,uri);
ServiceIntent.putExtra(Constants.DATA_CLIENT_ID,clientId);
.context.startService(mqttServiceIntent);
nt mqttServiceIntent = null;
ServiceIntent = new Intent(this.context, InuitsMqttService.class);
ServiceIntent.putExtra(Constants.ACTION,Constants.ACTION_DISCONNECT);
.context.startService(mqttServiceIntent);
nt mqttServiceIntent = null;
ServiceIntent = new Intent(this.context, InuitsMqttService.class);
ServiceIntent.putExtra(Constants.ACTION, Constants.ACTION_SUBSCRIBE);
ServiceIntent.putExtra(Constants.DATA_TOPIC, topic);
ServiceIntent.putExtra(Constants.DATA_QOS, qos);
.context.startService(mqttServiceIntent);
nt mqttServiceIntent = null;
ServiceIntent = new Intent(this.context, InuitsMqttService.class);
ServiceIntent.putExtra(Constants.ACTION, Constants.ACTION_UNSUBSCRIBE);
ServiceIntent.putExtra(Constants.DATA_TOPIC, topic);
.context.startService(mqttServiceIntent);
nt mqttServiceIntent = null;
ServiceIntent = new Intent(this.context, InuitsMqttService.class);
ServiceIntent.putExtra(Constants.ACTION, Constants.ACTION_PUBLISH);
ServiceIntent.putExtra(Constants.DATA_TOPIC, topic);
ServiceIntent.setData(Uri.parse(message));
.context.startService(mqttServiceIntent);