public class NotificationDevice extends Object
Modifier and Type | Method and Description |
---|---|
void |
cancelNotification()
This cancels the active notification from the device.
|
void |
disable()
Disables the notification device.
|
void |
enable()
Enables the notification device.
|
DeviceInfo |
getDeviceInfo()
Returns information about the notification device.
|
boolean |
isConnected()
Returns whether the notification device is connected to the Mobile device or not.
|
boolean |
isEnabled()
Returns whether the notification device is enabled or not.
|
void |
notify(Notification notification)
This sends the notification information to the device.
|
void |
release()
Releases the notification device.
|
public DeviceInfo getDeviceInfo()
public boolean isConnected()
public boolean isEnabled()
public void enable() throws NotificationException
Example Usage: device.enable();
NotificationException
- The exception will be thrown if the notification device enable fails.public void disable() throws NotificationException
Example Usage: device.disable();
NotificationException
- The exception will be thrown if the notification device disable fails.public void notify(Notification notification) throws NotificationException
Example Usage: Notification notification = new Notification(); notification.led.color = 0xFF0000; notification.led.onTime = 1000; notification.led.offTime = 500; notification.led.repeatCount = 2; notification.vibrate.pattern = new long[] {100,200,100,200,100,200}; notificationDevice.notify(notification);
NotificationException
- The exception will be thrown if the notification fails.public void cancelNotification() throws NotificationException
Example Usage: notificationDevice.cancelNotification();
NotificationException
- The exception will be thrown if the notification cancel fails.public void release() throws NotificationException
Example Usage: device.release();
NotificationException
- The exception will be thrown if the notification device release fails.