• BlackBerry Dynamics
  • Runtime library for Android applications
Package com.good.gd.support

Connected Application Support. More...


The BlackBerry Dynamics connected application system is a means of exchanging data and commands securely between separate devices. The connected application system includes part of the programming interface that implements the BlackBerry Dynamics Wearable Framework.

The BlackBerry Dynamics connected application system can set up communication between two devices if the following conditions are met:

  • One device is a handheld device on which a BlackBerry Dynamics application has been installed and activated for an end user. See under GDAndroid.authorize for details of activation and authorization.
  • The other device is a wearable device on which a BlackBerry Dynamics wearable application has been installed. See the BlackBerry Dynamics Wearable Framework page for details of BlackBerry Dynamics wearable application development.
  • The devices can communicate with each other using native platform capabilities. For example, the devices have been "paired".

Future versions of BlackBerry Dynamics may expand the above conditions to include other types of device.

The sequence of programming interfaces used to exchange data and commands in the BlackBerry Dynamics connected application system is as follows.

  1. The wearable device is discovered by the handheld application, using the queryConnectedApplications method.
  2. If necessary, and if allowed by enterprise policy, the wearable application on the wearable device is activated, using the startConnectedApplicationActivation method.
  3. The handheld application obtains an address for the wearable application, and vice versa, from a GDConnectedApplication instance.
  4. The addresses are used to send BlackBerry Dynamics AppKinetics service requests and responses, which contain the data and commands to be exchanged. See the icc package reference for an introduction to the AppKinetics programming interface.

Connected Application Discovery

The first step in setting up a BlackBerry Dynamics connected application link is discovery. Call the queryConnectedApplications method in the GDConnectedApplicationSupport instance to initiate discovery.

The query returns a collection of GDConnectedApplication objects. Each object represents an application, on a device, in one of the following connection states.

  • Activated. The other application has been activated for connection to the querying application. The querying application can obtain and utilize an address for the other application. See under Connected Application Addresses, below.
  • Not activated. The other application hasn't been activated for connection to the querying application. The next step would be to initiate activation, see under Connection Activation, below.
  • Activation started. The querying application has initiated activation but this hasn't yet completed, nor has it failed.
  • Activation cancelled. The querying application initiated activation but this was cancelled by the user. Activation could be initiated again.
  • Activation failed. The querying application initiated activation but an error occurred. Activation could be initiated again and might succeed next time.

The querying application must have completed BlackBerry Dynamics authorization processing before initiating connected application discovery. See under GDAndroid.authorize for details of general BlackBerry Dynamics authorization and application activation. Note that wearable applications do not as such execute BlackBerry Dynamics authorization. Instead, authorization of a wearable application is implicit when connection activation is processed after discovery by a BlackBerry Dynamics handheld application.

The BlackBerry Dynamics runtime invokes a callback in the GDConnectedApplicationSupportListener instance of the application when the connection state or availability of connected applications changes, going forwards.

Connection Activation

The next step after discovery is connection activation, if necessary. Activation of a connected application is only necessary once; connection activation creates a relationship between the two applications. The relationship persists until, for example, one or other of the applications is uninstalled, or one or other of the devices is reset.

Connection activation is initiated by the application that executed the discovery query. In the case of connection activation between a wearable application and a handheld application, this will always be the handheld application.

Use of wearable devices can be blocked by enterprise policy. The policy would be set in the enterprise BlackBerry Dynamics management console. If use is blocked then connection activation will fail. Check that use is not blocked before attempting connection activation, by calling the isConnectedApplicationActivationAllowed method in the GDConnectedApplicationSupport instance.

Initiate connection activation by calling the startConnectedApplicationActivation method in the GDConnectedApplicationSupport instance. Activation can involve:

  • Communication between the devices
  • Communication with the BlackBerry Dynamics infrastructure by the handheld device.
  • User interaction on both devices.

All communication and interaction is handled by the BlackBerry Dynamics runtime instances in both applications. Activation of the connection to a BlackBerry Dynamics wearable application utilizes the wearable notification stream mechanism.

The application will be notified of the success or failure of activation by invocation of a callback in its GDConnectedApplicationSupportListener instance.

Connected Application Addresses

The other applications with which an application can communicate are identified by connected application addresses. Each instance of a connected application has a unique address.

Addresses may be obtained by connected application discovery, see above, or as a result of connection activation. Use the GDConnectedApplication instance for the other application to get the address value. Addresses cannot be generated from application identifiers, device identifiers, or other known values. Addresses should be treated as opaque values and only utilized as described below.

Data and commands can be exchanged between connected applications using the BlackBerry Dynamics AppKinetics services programming interface. To send a service request, call sendTo (GDServiceClient) and pass a connected application address as the application parameter value. The GDServiceListener.onReceiveMessage callback in the application that receives the request will receive an address that can be used to send a service response, using replyTo (GDService) .

Connected application addresses can be stored persistently, and can be used to check whether an application that was previously activated for connection is currently available.

Connection Removal

The connection to another application can be removed. Removal is permanent. It is typically initiated by the end user, because of something happening to the device on which the connected application is running.

Some circumstances in which the end user would want to remove the connection to a device are:

  • The device has been lost.
  • The device is going to be, or has been, factory reset.
  • The user believes the security of the device has been compromised.
  • The user wants to stop using the connected application feature with this device.

Removal of the connection also results in the BlackBerry Dynamics secure store of the other application being wiped. Any application data there would be deleted. The wipe takes place immediately, if the other application is connected when removal is initiated. If the other application isn't connected at that time, the wipe takes place as soon as it does connect. Between the initiation and finalization of removal, the connection is in a special Removed state.

The device would still be discoverable after removal of the connection. A new connection could be activated. Data from the BlackBerry Dynamics secure store wouldn't be restored.

Initiate removal of a connection by calling the removeConnectedApplication method in the GDConnectedApplicationSupport instance.


class  GDConnectedApplication
 Connected application details. More...
enum  GDConnectedApplicationState
 Constants for connected application state. More...
class  GDConnectedApplicationSupport
 Connected application system interface. More...
interface  GDConnectedApplicationSupportListener
 Connected application system results observer. More...
enum  GDConnectedApplicationType
 Constants for connected application device type. More...