|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.blackberry.api.accessory.AccessoryManager
public abstract class AccessoryManager
Manages the associations of accessories and applications.
In order for an application to be started when an accessory attached, the application must do one of two things:
When applications are started by the, a Behavior Global Event is broadcasted
as a global event. In this way, applications will know
why they were started and can perform application specific features based on this context.
If multiple applications are associated with the same accessory type or accessory GUID, then users may be provided a choice.
Accessory.TYPE_* constants in this class.
accessoryManager.registerApplication( Accessory.TYPE_CHARGER, ApplicationDescriptor.currentApplicationDescriptor() );
accessoryManager.registerApplication( "app id 1234", ApplicationDescriptor.currentApplicationDescriptor() );
net.rim.blackberry.api.behavior.BehaviorGlobalEvent},
net.rim.blackberry.api.accessory.Accessory},
net.rim.device.api.system.ApplicationManager}| Method Summary | ||
|---|---|---|
static AccessoryManager |
getAccessoryManager()
Returns an Accessory Manager instance. |
|
abstract Accessory |
getConnectedAccessory()
Returns the currently connected accessory. |
|
abstract boolean |
isApplicationRegistered(int accessoryType)
Checks if an application is already registered for the given accessory type. |
|
abstract boolean |
isApplicationRegistered(String appId)
Checks if an application is already registered for the given accessory guid. |
|
abstract void |
registerApplication(int accessoryType,
ApplicationDescriptor appDescriptor)
Registers an application to start for a given accessory type. |
|
abstract void |
registerApplication(String applicationId,
ApplicationDescriptor appDescriptor)
Register against an application identifier so that an accessory with a matching application identifier will start the given application. |
|
abstract void |
unregisterApplication(int accessoryType,
ApplicationDescriptor appDescriptor)
Unregisters an application against an accessory type. |
|
abstract void |
unregisterApplication(String appId,
ApplicationDescriptor appDescriptor)
Unregisters an application against an application ID. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static AccessoryManager getAccessoryManager()
public abstract void registerApplication(String applicationId,
ApplicationDescriptor appDescriptor)
Each time an accessory with the given app id is attached, then the given application will launch automatically.
If an application is already registered against the given app id, then the given application will replace it.
applicationId - a globally unique identifier of the accessory.appDescriptor - a non-null application descriptor
NullPointerException - if applicationId or appDescriptor is null
public abstract void registerApplication(int accessoryType,
ApplicationDescriptor appDescriptor)
If an application is already registered against the given accessory type, then the given application will replace it.
accessoryType - one of the TYPE_* constants defined in this class.appDescriptor - a non null application descriptor
NullPointerException - if appDescriptor is null
public abstract void unregisterApplication(String appId,
ApplicationDescriptor appDescriptor)
appId - a non-null unique identifier of an application;appDescriptor - a non-null application descriptor
NullPointerException - if guid or appDescriptor is null.
public abstract void unregisterApplication(int accessoryType,
ApplicationDescriptor appDescriptor)
accessoryType - one of the TYPE_* constants defined in this class.appDescriptor - a non null application descriptor
NullPointerException - if appDescriptor is null
IllegalArgumentException - if accessoryType is invalid.public abstract Accessory getConnectedAccessory()
public abstract boolean isApplicationRegistered(int accessoryType)
accessoryType - an accessory type to check
public abstract boolean isApplicationRegistered(String appId)
appId - a non-null unique identifier of an application;
NullPointerException - if guid is null
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal