at.abraxas.amarino.plugin
Class BackgroundService
java.lang.Object
Service
at.abraxas.amarino.plugin.BackgroundService
public abstract class BackgroundService
- extends Service
Field Summary |
boolean |
pluginEnabled
true if the plug-in has been enabled, false otherwise |
int |
pluginId
Unique id assigned by Amarino to identify this plug-in instance |
Method Summary |
abstract void |
cleanup()
When this service receives a DISABLE message from Amarino it calls cleanup(). |
abstract boolean |
init()
This method should implement your initialization sequence (register and start sensors, etc). |
IBinder |
onBind(Intent intent)
|
void |
onCreate()
|
void |
onDestroy()
|
void |
onStart(Intent intent,
int startId)
|
int |
onStartCommand(Intent intent,
int flags,
int startId)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pluginId
public int pluginId
- Unique id assigned by Amarino to identify this plug-in instance
pluginEnabled
public boolean pluginEnabled
- true if the plug-in has been enabled, false otherwise
BackgroundService
public BackgroundService(java.lang.String tag,
boolean debug)
onBind
public IBinder onBind(Intent intent)
onCreate
public void onCreate()
onDestroy
public void onDestroy()
onStartCommand
public int onStartCommand(Intent intent,
int flags,
int startId)
onStart
public void onStart(Intent intent,
int startId)
init
public abstract boolean init()
- This method should implement your initialization sequence (register and start sensors, etc).
The init method is called directly after receiving the ENABLE message from Amarino.
Return true if your plug-in could be initialized without errors and is up and running.
Return false if your initialization failed.
- Returns:
- true if plug-in could be enabled successfully, otherwise false
cleanup
public abstract void cleanup()
- When this service receives a DISABLE message from Amarino it calls cleanup().
But only if your init() method returned true, otherwise cleanup is omitted.