|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EventClient
EventClient is the entry point into the Amazon Mobile Analytics SDK where AnalyticsEvent
objects are created,
recorded, and submitted to the Amazon Mobile Analytics Service.
// get the event client from your MobileAnalyticsManager instance EventClient eventClient = mobileAnalyticsManager.getEventClient(); // create and record an event Event level1CompleteEvent = eventClient.createEvent("level1Complete"); eventClient.recordEvent(level1CompleteEvent);
The example below demonstrates how to submit events to the Amazon Mobile Analytics Service. You have direct control over when events are submitted in your app. Events are submitted in a background thread.
Example:// submit events to the website EventClient eventClient = mobileAnalyticsManager.getEventClient(); eventClient.submitEvents();Amazon recommends that you call
submitEvents
in the onPause method of each Activity object that records events.
The SDK ensures that you do not submit events too frequently. If you try submitting events within one minute of a previous
submission, the submission request will be ignored.
Method Summary | |
---|---|
void |
addGlobalAttribute(java.lang.String attributeName,
java.lang.String attributeValue)
Adds the specified attribute to all subsequently recorded events Note: The maximum allowed attributes and metrics on a single event is 40. |
void |
addGlobalAttribute(java.lang.String eventType,
java.lang.String attributeName,
java.lang.String attributeValue)
Adds the specified attribute to all subsequently recorded events with the specified event type Note: The maximum allowed attributes and metrics on a single event is 40. |
void |
addGlobalMetric(java.lang.String metricName,
java.lang.Double metricValue)
Adds the specified metric to all subsequently recorded events Note: The maximum allowed attributes and metrics on a single event is 40. |
void |
addGlobalMetric(java.lang.String eventType,
java.lang.String metricName,
java.lang.Double metricValue)
Adds the specified metric to all subsequently recorded events with the specified event type Note: The maximum allowed attributes and metrics on a single event is 40. |
AnalyticsEvent |
createEvent(java.lang.String eventType)
Create an event with the specified eventType. |
void |
recordEvent(AnalyticsEvent event)
Record the specified event to the local filestore |
void |
removeGlobalAttribute(java.lang.String attributeName)
Removes the specified attribute. |
void |
removeGlobalAttribute(java.lang.String eventType,
java.lang.String attributeName)
Removes the specified attribute. |
void |
removeGlobalMetric(java.lang.String metricName)
Removes the specified metric. |
void |
removeGlobalMetric(java.lang.String eventType,
java.lang.String metricName)
Removes the specified metric. |
void |
submitEvents()
Submit all recorded events. |
Method Detail |
---|
void recordEvent(AnalyticsEvent event)
event
- The event to persistAnalyticsEvent createEvent(java.lang.String eventType)
eventType
- the type of event to create
void addGlobalAttribute(java.lang.String attributeName, java.lang.String attributeValue)
attributeName
- the name of the attribute to addattributeValue
- the value of the attributevoid addGlobalAttribute(java.lang.String eventType, java.lang.String attributeName, java.lang.String attributeValue)
eventType
- the type of events to add the attribute toattributeName
- the name of the attribute to addattributeValue
- the value of the attributevoid addGlobalMetric(java.lang.String metricName, java.lang.Double metricValue)
metricName
- the name of the metric to addmetricValue
- the value of the metricvoid addGlobalMetric(java.lang.String eventType, java.lang.String metricName, java.lang.Double metricValue)
eventType
- the type of events to add the metric tometricName
- the name of the metric to addmetricValue
- the value of the metricvoid removeGlobalAttribute(java.lang.String attributeName)
attributeName
- the name of the attribute to removevoid removeGlobalAttribute(java.lang.String eventType, java.lang.String attributeName)
eventType
- the type of events to remove the attribute fromattributeName
- the name of the attribute to removevoid removeGlobalMetric(java.lang.String metricName)
metricName
- the name of the metric to removevoid removeGlobalMetric(java.lang.String eventType, java.lang.String metricName)
eventType
- the type of events to remove the metric frommetricName
- the name of the metric to removevoid submitEvents()
AnalyticsConfig
for customizing which Internet connection the SDK can submit on.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |