• BlackBerry Dynamics
  • Runtime library for Android applications
  • 12.0.1.79
GDServiceClientListener Interface Reference

Handler for AppKinetics consumer events. More...

Description

Responses to AppKinetics service requests are handled by creating a class that implements this interface.

This class is part of the service consumer side of the AppKinetics programming interface.

The GDServiceClientListener.onReceiveMessage callback would be invoked after the application had sent a service request to a service provider, and the provider had responded or an error had occurred.

See also
The icc package reference for an overall description of AppKinetics.

This class also includes a callback that is invoked when transmission of a service request completes.

Callback Invocation Sequence

The callbacks in this class will be invoked in the following sequence when a service response is received.

  1. onReceivingAttachments once, if the service response has any file attachments.
  2. onReceivingAttachmentFile once for each file attachment.
  3. onReceiveMessage once.

The first two of these callbacks enable the application to display a receiving status in its user interface. No action should be taken on any attachment files until the last callback, GDServiceClientListener.onReceiveMessage .

Public Member Functions

void onReceivingAttachments (String application, int numberOfAttachments, String requestID)
 Service response file attachments transmission start callback. More...
 
void onReceivingAttachmentFile (String application, String path, long size, String requestID)
 Service response individual file attachment transmission start callback. More...
 
void onReceiveMessage (String application, Object params, String[] attachments, String requestID)
 Service response callback. More...
 
void onMessageSent (String application, String requestID, String[] attachments)
 Service request transmission complete callback. More...
 

Member Function Documentation

◆ onReceivingAttachments()

void onReceivingAttachments ( String  application,
int  numberOfAttachments,
String  requestID 
)

This callback is invoked when file attachments are about to be received through the AppKinetics system. The number of files that are about to be received is passed as a parameter.

This callback will be invoked once per service response that has attachments. See under Callback Invocation Sequence, above, for its position in the order of service response callbacks.

The method that is invoked could display a receiving status in its user interface. The status could be cleared on receipt of the GDServiceClientListener.onReceiveMessage callback.

Parameters
applicationString containing the native application identifier of the provider application that sent the service response to which the files are attached.
numberOfAttachmentsint number of files that are about to be received, always one or more. This callback isn't invoked for service responses that have no attachments.
requestIDString containing the unique identifier of the original service request, the response to which the files are attached.

◆ onReceivingAttachmentFile()

void onReceivingAttachmentFile ( String  application,
String  path,
long  size,
String  requestID 
)

This callback is invoked when an individual file attachment is about to be received through the AppKinetics system. The path and size of the file that is about to be received are passed as parameters.

This callback will be invoked once per attachment. See under Callback Invocation Sequence, above, for its position in the order of service response callbacks.

The method that is invoked could display or update a receiving status in its user interface. The status could be cleared on receipt of the GDServiceClientListener.onReceiveMessage callback.

Parameters
applicationString containing the native application identifier of the provider application that sent the service response to which the file is attached.
pathString containing the path of the attachment. The value will be the same as one of the elements in the attachments parameter passed to the subsequent GDServiceClientListener.onReceiveMessage invocation.
sizelong representing the size of the file in bytes.
requestIDString containing the unique identifier of the original service request, the response to which the files are attached.

◆ onReceiveMessage()

void onReceiveMessage ( String  application,
Object  params,
String[]  attachments,
String  requestID 
)

This callback is invoked when a response is received to an AppKinetics service request. The parameters give the details of the service response.

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

See under Callback Invocation Sequence, above, for the position of this callback in the order of service response callbacks.

A service response may be received in relation to a call to sendTo (GDServiceClient) that was accepted by the AppKinetics system.

The response can include file attachments and a results object from the provider application. Check the type of the results object to determine whether the service request succeeded.

If the results object is of type GDServiceError then the service request failed. The object will have either an AppKinetics system error code, or a custom error code from the service provider. Additional data about the error may be in the details attribute. See GDServiceError for details.

If the results object isn't of type GDServiceError then the service request succeeded. In that case the results object will be of a valid service parameter type, as defined under Service Parameters in the icc package reference.

Parameters
applicationString containing the native application identifier of the provider application to which the original service request was sent.
paramsThe results object, as returned by the provider application.
attachmentsArray of String objects containing the paths of files that were attached to the service response. See under File Attachments in the icc package reference.
requestIDString containing the ID assigned to the original service request. An application that makes multiple concurrent service requests can use this value to tie the response back to the original request. The application must have retained the ID from when sendTo (GDServiceClient) was originally called.

◆ onMessageSent()

void onMessageSent ( String  application,
String  requestID,
String[]  attachments 
)

This callback is invoked when the delivery of an AppKinetics service request completes.

Invocation of this callback notifies the application that:

  • Any files that were attached to the service request have been copied to the secure store of the service provider.
  • An independent copy of the parameters of the request, if any, has been made available to the service provider.

The method that is invoked can delete or modify any of the original file attachments, and free any resources used to hold the request parameters.

See also
sendTo (GDServiceClient) for details of sending service requests.
Parameters
requestIDString containing the unique identifier of the service request whose sending has completed.
attachmentsArray of String objects containing the paths of any files that were attached to the service request.
applicationString containing the native application identifier of the application to which the service request was sent.