java.lang.Object | |
↳ | com.urbanairship.analytics.Analytics |
This class is the primary interface to the UrbanAirship Analytics API.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ACTION_APP_BACKGROUND | Intent action for application background. | |||||||||
String | ACTION_APP_FOREGROUND | Intent action for application foreground. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static void |
activityStarted(Activity activity)
Call this in your Activity's
onStart method to notify Analytics that the activity has started. | ||||||||||
static void |
activityStopped(Activity activity)
Call this in your Activity's
onStop method to notify Analytics that the activity has stopped. | ||||||||||
void |
addEvent(Event event)
Adds an analytics event.
| ||||||||||
void |
associateIdentifiers(AssociatedIdentifiers identifiers)
Associates identifiers with the device.
| ||||||||||
String |
getConversionSendId()
Returns the last stored send Id from when a push conversion was detected.
| ||||||||||
boolean |
isAppInForeground()
Determines if the application is in the foreground.
| ||||||||||
boolean | isEnabled() | ||||||||||
void |
recordLocation(Location location)
Records a location.
| ||||||||||
void |
recordLocation(Location location, LocationRequestOptions options, LocationEvent.UpdateType updateType)
Records a location.
| ||||||||||
void |
setEnabled(boolean enabled)
Sets analytics enabled.
| ||||||||||
void |
trackScreen(String screen)
Initiates screen tracking for a specific app screen, must be called once per tracked screen.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Intent action for application background.
Intent action for application foreground.
Call this in your Activity's onStart
method to notify Analytics that the activity has started.
This is non-blocking and should be called on the application's main thread. If your application
targets Android Ice Cream Sandwich (api 14) or above, this method is no longer required.
activity | The activity that is currently starting. |
---|
Call this in your Activity's onStop
method to notify Analytics that the activity has stopped.
This is non-blocking and should be called on the application's main thread. If your application
targets Android Ice Cream Sandwich (api 14) or above, this method is no longer required.
activity | The activity that is currently stopping. |
---|
Adds an analytics event.
event | The event to be triggered. |
---|
Associates identifiers with the device. This will create and add an event that will be sent up with other analytics events. Previous associated identifiers will be replaced.
identifiers | An AssociatedIdentifiers instance.
|
---|
Returns the last stored send Id from when a push conversion was detected.
Determines if the application is in the foreground.
true
if the application is in the foreground, otherwise
false
.
Returns true
if analytics is enabled and analyticsEnabled
is set to true
, otherwise false
.
true
if analytics is enabled, otherwise false
.
Records a location.
location | The location to record. |
---|
Records a location.
location | The new location. |
---|---|
options | The location request options. |
updateType | The update type. |
Sets analytics enabled. When disabling analytics, any locally stored events will be deleted.
Features that depend on analytics being enabled may not work properly if it's disabled (reports, region triggers, location segmentation, push to local time).enabled | true to enable analytics, false to disable.
|
---|
Initiates screen tracking for a specific app screen, must be called once per tracked screen.
screen | The screen's string identifier. |
---|