|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
See:
Description
Packages | |
---|---|
org.deacon | |
org.deacon.demo | |
org.deacon.test |
Deacon is a push notifications library intended for use on Android devices, but which is also usable in pure-Java form. Deacon is free and open-source software, and is produced by the members of The Deacon Project.
Deacon can be used in two "modes", pure-Java and Android. Each is detailed below.
You can integrate Deacon into your Android app or service by creating a new Deacon object, configuring it, then subscribing the object's context to receive callbacks when push notifications are received.
uses-permission android:name="android.permission.INTERNET"
uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"
Deacon myDeacon = new Deacon("data.myserver.com", 4670, this);
myDeacon.joinChannel("channelname", 0);
myDeacon.register(this);
myDeacon.start();
Using Deacon in pure-Java is just like using it in Android, except that instead of instantiating Deacon
, you instantiate its parent class, DeaconService
. The configuration is the same, but the instantiating context is not required when you make a new DeaconService, and you must start and stop the service.
channel
and payload
members. Thus, your onPush method will need to separate out the pushes based on channel the same way you might detect and separate button pushes in an onClick(View view)
method in Android.Deacon
or DeaconService
object you instantiate. If Deacon is stopped while running (for example due to a momentary interruption in network connectivity on Android), it will automatically retrieve missed push notifications from the Meteor server, as long as the catchUpTimeOut has not expired. For example, setting a catchUpTimeOut interval of 60 will attempt to catch up all subscribed channels as long as the service is restarted within 60 seconds of stopping.
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |