public class WLAnalytics
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
WLAnalytics.DeviceEvent
Set of device attribute changes WLAnalytics can register event listeners for.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SHARED_PREF_KEY |
static java.lang.String |
SHARED_PREF_KEY_USER_ID |
static java.lang.Object |
WAIT_LOCK |
| Constructor and Description |
|---|
WLAnalytics() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addDeviceEventListener(WLAnalytics.DeviceEvent deviceEvent)
Enable analytics to capture the specified DeviceEvent
|
static void |
disable()
Disable persistent capture of analytics data.
|
static void |
enable()
Enable persistent capture of analytics data.
|
static void |
init(Application app)
Initialize WLAnalytics API.
|
static void |
log(java.lang.String message,
JSONObject additionalMetadata)
Log data you want to be captured in the context of "analytics".
|
static void |
log(java.lang.String message,
JSONObject additionalMetadata,
java.lang.Throwable t)
Log exceptions you want to be captured in the context of "analytics".
|
static void |
logAppBackground()
Manually record the application successfully exiting from the user (entering the background) - used
to recored app session analytics.
|
static void |
logAppCrash(java.lang.Throwable t)
Manually record the application crashing - used to record app session analytics.
|
static void |
logAppForeground()
Manually record the application entering the foreground - used to record app session analytics.
|
static void |
removeDeviceEventListener(WLAnalytics.DeviceEvent deviceEvent)
Disable analytics from capturing the specified DeviceEvent
|
static void |
send()
Send the accumulated log data when the persistent log buffer exists and is not empty.
|
static void |
send(WLRequestListener listener)
See
send() |
static void |
setContext(Context context)
Deprecated.
use WLAnalytics.init() instead
Context object must be set in order to use the WLAnalytics API. This is called automatically by WL.init.
|
static void |
setUserContext(java.lang.String _user)
Specify current application user.
|
static void |
triggerFeedbackMode()
Method Triggers Inapp Feedback mode
Triggers In app Feedback Mode and enabled the user to send the feedback to Bluemix Analytic console.
|
static void |
unsetUserContext()
Unset any user context previously set.
|
public static final java.lang.String SHARED_PREF_KEY
public static final java.lang.String SHARED_PREF_KEY_USER_ID
public static final java.lang.Object WAIT_LOCK
public static void init(Application app)
app - Android Application to instrument with WLAnalytics.public static void addDeviceEventListener(WLAnalytics.DeviceEvent deviceEvent)
deviceEvent - the DeviceEvent to capturepublic static void removeDeviceEventListener(WLAnalytics.DeviceEvent deviceEvent)
deviceEvent - the DeviceEvent to disablepublic static void triggerFeedbackMode()
public static void setContext(Context context)
context - Android Context objectpublic static void setUserContext(java.lang.String _user)
_user - User User id for current app user.public static void unsetUserContext()
public static void enable()
public static void disable()
public static void log(java.lang.String message,
JSONObject additionalMetadata)
message - Message to be logged.additionalMetadata - Meta-data associated with log message.public static void log(java.lang.String message,
JSONObject additionalMetadata,
java.lang.Throwable t)
message - Message to be logged.additionalMetadata - Meta-data associated with log message.t - a Throwable whose stack trace is converted to string and loggedpublic static void send()
WLAnalytics with capture
(see enable()) turned on.public static void send(WLRequestListener listener)
send()listener - WLRequestListener which specifies an onSuccess callback and an onFailure callback (see WLRequestListener)public static void logAppForeground()
public static void logAppBackground()
public static void logAppCrash(java.lang.Throwable t)