• BlackBerry Dynamics
  • Runtime library for Android applications
  • 9.1.0.122
GDService Class Reference

AppKinetics service provider. More...

Description

This class is mandatory for service provider applications within the AppKinetics system. This class also includes the programming interface for sending AppKinetics service responses. This interface would be utilized in the code of the listener of this class.

For an overall description of AppKinetics, see the icc package reference. To utilize this programming interface, the application must meet the requirements listed under Service Provider Requirements.

The methods in this interface cannot be used until BlackBerry Dynamics authorization processing is complete, see under GDAndroid.authorize.

See also
GDServiceError
GDServiceClient for the parts of the interface that are specific to service consumers.
GDAndroid.getServiceProvidersFor for the service discovery programming interface.

Static Public Member Functions

static void replyTo (String application, Object params, GDICCForegroundOptions option, String[] attachments, String requestID) throws GDServiceException
 Send a response or error. More...
 
static void bringToFront (String application) throws GDServiceException
 Bring another application to the foreground. More...
 
static void setServiceListener (GDServiceListener listener) throws GDServiceException
 Listener that implements the services provided by the application. More...
 

Static Public Attributes

static final String GDFrontRequestService = "com.good.gd.icc"
 BlackBerry Dynamics service identifier for front request. More...
 
static final String GDFrontRequestMethod = "FRONT_REQ"
 BlackBerry Dynamics method name for front request. More...
 

Member Function Documentation

◆ replyTo()

static void replyTo ( String  application,
Object  params,
GDICCForegroundOptions  option,
String[]  attachments,
String  requestID 
) throws GDServiceException
static

Call this method to respond to a consumer application from which an AppKinetics service request has been received. The response can include a results object and file attachments to be conveyed to the consumer application. The results object will notify the consumer of the success or failure of the request.

For an overall description of AppKinetics see the icc package reference.

If the request failed for any reason, pass a GDServiceError as the results object. The GDServiceError should be the result of calling one of the constructor functions with a suitable code for the error condition that caused the failure. Include any additional data by passing a suitable object as the details parameter of the constructor. See GDServiceError for details.

If the request succeeded then pass a results object of a valid service parameter type, as defined under Service Parameters in the icc package reference.

Parameters
applicationString containing the native application idenitifer of the consumer, as supplied in the original service request.
paramsObject for the results object.
optionGDICCForegroundOptions specifying the foreground execution preference after delivery of the response:
GDICCForegroundOptions.PreferPeerInForeground for the consumer application being in the foreground.
GDICCForegroundOptions.PreferMeInForeground for this application being in the foreground.
GDICCForegroundOptions.NoForegroundPreference to specify that there is no preference.
See also the notes under Foreground Execution in the icc package reference.
attachmentsArray of String objects containing the paths of files in the BlackBerry Dynamics secure file system that are to be attached to the response. See under File Attachments in the icc package reference.
requestIDString containing the identifier of the service request to which this is a response. The identifier will have been passed as a parameter to the delegated handler that implements the service.
Exceptions
GDServiceExceptionif the response was not accepted by the AppKinetics system.

◆ bringToFront()

static void bringToFront ( String  application) throws GDServiceException
static

Call this method to bring another application to the foreground. This could be used when the application is a service provider, to bring the service consumer back to the foreground without sending a response. See under Foreground Execution in the icc package reference for details. Don't use this method outside the context of service request processing. This method cannot specify which part of the other application's user interface will be opened, i.e. which activity.

Parameters
applicationString containing the native application identifier of the application to be brought to the foreground.
Exceptions
GDServiceExceptionif the specified application wasn't brought to the foreground, based on the return code from the native layer.

◆ setServiceListener()

static void setServiceListener ( GDServiceListener  listener) throws GDServiceException
static

When an AppKinetics service request is received, the BlackBerry Dynamics runtime dispatches an event to an observer within the application. Call this method to set the observer object.

The observer object must:

  • Implement the GDServiceListener interface.
  • Process received service requests in accordance with the published interface of the service provided. The interface could be, for example, a BlackBerry Dynamics service definition.

The processing could include calling replyTo (GDService) to issue a service response.

Parameters
listenerObject that implements the GDServiceListener interface to set as the observer, typically this.

Member Data Documentation

◆ GDFrontRequestService

final String GDFrontRequestService = "com.good.gd.icc"
static

Use this constant to send or identify a front request. See under Foreground Execution and Front Request Programming Interface in the icc package reference.

◆ GDFrontRequestMethod

final String GDFrontRequestMethod = "FRONT_REQ"
static

Use this constant to identify the method in a front request. See under Foreground Execution and Front Request Programming Interface in the icc package reference.