BlackBerry Dynamics log manager. More...
This class contains a number of programming interfaces for managing BlackBerry Dynamics activity logs.
The BlackBerry Dynamics runtime logs its activity to files in the secure store on the device. The application can use the programming interface in this class to:
In the case that the application implements a custom user interface, it can be notified of progress by the BlackBerry Dynamics runtime. A notification will be dispatched by the runtime when there is any change to the upload state, or to the amount of data uploaded. For example, a notification would be dispatched when:
When a notification is received, the application code could determine the new status and then update the user interface accordingly, for example:
To receive notifications, register a receiver class:
BroadcastReceiver
object.Implementation of a receiver of activity log upload notifications is only required if the application has its own monitoring user interface. It should be easier to display the built-in monitoring user interface, by calling the openLogUploadUI method.
Public Member Functions | |
boolean | detailedLoggingFor (long duration) |
Switch on detailed activity logging in the BlackBerry Dynamics Runtime. More... | |
boolean | startUpload () |
Upload current activity logs. More... | |
boolean | cancelUpload () |
Cancel activity log upload. More... | |
boolean | suspendUpload () |
Suspend activity log upload. More... | |
boolean | resumeUpload () |
Resume activity log upload. More... | |
GDLogUploadState | getUploadState () |
Current activity log upload state. More... | |
long | getUploadBytesSent () |
Amount of activity log data uploaded so far. More... | |
long | getUploadBytesTotal () |
Total amount of activity log data to upload. More... | |
boolean | openLogUploadUI () throws GDNotAuthorizedError |
Open the built-in activity log upload user interface. More... | |
Static Public Member Functions | |
static GDLogManager | getInstance () |
Get a reference to the BlackBerry Dynamics activity log manager object. More... | |
Static Public Attributes | |
static final long | DETAILED_MAXIMUM_DURATION = TimeUnit.MINUTES.toMillis(15) |
Maximum duration of user detailed logging. More... | |
static final String | GD_LOG_UPLOAD_CHANGE_ACTION = "com.good.gd.LOG_UPLOAD_CHANGE" |
Intent Filter key for changes to BlackBerry Dynamics activity log upload progress. More... | |
|
static |
This method returns a reference to the BlackBerry Dynamics activity log manager object. The activity log manager is a "singleton class".
boolean detailedLoggingFor | ( | long | duration | ) |
Call this method to switch on detailed logging by the BlackBerry Dynamics runtime.
The runtime writes more messages to its activity log if detailed logging is switched on. Detailed logging slows down the runtime, and increases the amount of device storage occupied by the activity logs in the secure store. For these reasons, detailed logging can only be switched on by the application for a specified duration, and there is a maximum allowed duration. The maximum duration is 15 minutes and is given by the DETAILED_MAXIMUM_DURATION constant.
Detailed activity logging can also be switched on by the BlackBerry Dynamics management console, in which there are a number of options. Check the user interface and documentation of the management console for details.
The ability to switch on detailed logging from the application code can be blocked by enterprise policy. See the GDAppConfigKeyPreventUserDetailedLogs
item in the collection returned by the GDAndroid.getApplicationConfig method.
Detailed activity logging can be switched off by the application code, if it was switched on by the application code. If detailed logging is switched on by the managment console then it cannot be switched off by the application code. Switch off detailed logging by calling this method and passing zero or a negative duration.
duration | long representation of the duration for which detailed logging is to be switched on, in milliseconds.Pass zero or a negative number to switch off detailed logging. |
true
if the parameter value is less than or equal to the maximum allowed duration. false
otherwise.boolean startUpload | ( | ) |
Call this method to upload the current activity log files for support purposes. The logs will be uploaded to a server in the BlackBerry Dynamics Network Operation Center (NOC).
BlackBerry Dynamics support staff have access to the server to which log files are uploaded, and can use the data for support analysis.
This method can be used to upload logs even if BlackBerry Dynamics authorization has failed. The user identifier with which the application was activiated will be needed by support staff, to identify uploaded files. The user identifier is typically the end user's enterprise email address. If authorization has failed or been cancelled without a user identifier being successfully entered, then no logs will be uploaded.
The upload takes place in background and will be retried as necessary by the runtime. Progress can be monitored and managed by using the programming interface of this class.
The runtime makes a copy of its current activity log files when this method is called. The copy is retained until upload completes or is cancelled. If an earlier log upload is still in progress when this method is called, the current activity log files are added to the in-progress upload.
true
if upload was started OK. false
otherwise or if this application is in the Wiped state. boolean cancelUpload | ( | ) |
Call this method to cancel the upload of activity logs, which would have been started by calling startUpload . Upload cannot be resumed after cancellation.
true
if upload was cancelled OK. false
otherwise or if this application is in the Wiped state. boolean suspendUpload | ( | ) |
Call this method to suspend the upload of activity logs, which would have been started by calling startUpload . Upload can be resumed after suspension.
true
if upload was suspended OK. false
otherwise or if this application is in the Wiped state. boolean resumeUpload | ( | ) |
Call this method to resume the upload of activity logs after suspension. Upload would have been suspended by calling suspendUpload .
true
if upload was resumed OK. false
otherwise or if this application is in the Wiped state. GDLogUploadState getUploadState | ( | ) |
long getUploadBytesSent | ( | ) |
long
integer representing the amount of data sent so far, in bytes. long getUploadBytesTotal | ( | ) |
long
integer representing the total data to be sent, in bytes. boolean openLogUploadUI | ( | ) | throws GDNotAuthorizedError |
This method opens a complete user interface that gives the user an option to start uploading activity log files, then displays progress and a number of management options.
The upload user interface is built in to the BlackBerry Dynamics runtime. This method makes it possible to include the upload user interface in the application's own user interface. It is an alternative to implementing a whole user interface in the application code, using the other methods in this class.
true
if the activity log upload user interface opened OK, or was already open. false
if this application is in the Wiped state.com.good.gd.error.GDNotAuthorizedError | if BlackBerry Dynamics authorization processing has not yet completed. |
|
static |
The maximum duration for which detailed logging can be switched on by the detailedLoggingFor method.
|
static |
Use this value as the Intent Filter key to register a broadcast receiver that will be notified when there is a change to the BlackBerry Dynamics log upload status. See the GDLogManager class reference for details.