Medialets Analytics SDK 2.x for Android


Skip to end of metadata
Go to start of metadata

com.medialets.android.analytics

Class MMAnalyticsManager

java.lang.Object

com.medialets.android.analytics.MMAnalyticsManager


public class MMAnalyticsManager
extends java.lang.Object


Method Summary

static MMAnalyticsManager sharedInstance(android.content.Context context)
          Returns an instance of the MMAnalyticsManager.
String getAppId()
          Returns the Medialets Muse application id associated with the MMAnalyticsManager.
String getAppVersion()
          Returns the version of the application associated with the MMAnalyticsManager.
void start(String appID, String appVersion, boolean useLocation)
          Starts the MMAnalyticsManager in order to track events for the application. This method tracks the start of a new run of the application.
void pause()
          Closes out the current run of the application and attempts to post the run information and any custom events that you have tracked to the Medialets Muse servers.
void resume()
          Tracks the start of a new run of the application.
void stop()
          Stops the MMAnalyticsManager from tracking events and attempts to post run information and tracked custom events to the Medialets Muse servers.
void trackEvent(MMEvent ev)
          Adds the event to the MMAnalyticsManager. Stores the event locally to post to server at a later time.
void registerExceptionHandler()
          This method sets the MMAnalyticsManager to handle uncaught exceptions running in the current application thread.


Method Detail

sharedInstance

public static MMAnalyticsManager sharedInstance(android.content.Context context)

Returns an instance of the MMAnalyticsManager.

Parameters:
context - The application/activity context for access to Android utilities

Returns:
The instance of MMAnalyticsManager.

Since:
2.0


getAppId

public String getAppId()

Returns the Medialets Muse application id associated with the MMAnalyticsManager.

Returns:
The Medialets Muse application id of the associated application

Since:
2.0


getAppVersion

public String getAppVersion()

Version of the application associated with the MMAnalyticsManager.

Returns:
String representation of the version

Since:
2.0


start

public void start(String appID, String appVersion, boolean useLocation)

Starts the MMAnalyticsManager in order to track events for the application. This method tracks the start of a new run of the application. Location tracking is enabled/disabled based on useLocation parameter.

Parameters:
appID - The unique application identifier generated by Medialets Muse
website for your application. Must not be null.

appVersion - The version number for your application.

useLocation - Set this to true if you would like location information
automatically associated with your application events, otherwise set this to false. Please note that the user should be given the option to opt out of having their location information associated with tracking events before this method is called. This method makes no attempt to ask for permission to make use of a user’s location. Device location notifications are received in the background to minimize interference with the application’s behavior.

Since:
2.0


pause

public void pause()

Closes out the current run of the application and attempts to post the run information and any custom events that you have tracked to the Medialets Muse servers.

Since:
2.0


resume

public void resume()

Tracks the start of a new run of the application.

Since:
2.0


stop

public void stop()

Stops the MMAnalyticsManager from tracking events and attempts to post run information and tracked custom events to the Medialets Muse servers. If start() is called within 10 seconds of a stop() call the previous run will be resumed.

Since:
2.0


trackEvent

public void trackEvent(MMEvent event)

Adds the event to the MMAnalyticsManager. Stores an event locally to post to the server at a later time. For more information on event tracking, see: MMEvent Class Reference.

Parameters:
event - An MMEvent instance. Create a MMEvent, use the MMEvent methods to add data to the event if necessary, then pass the event to this routine to save the event.

Sample:

MMEvent myEvent = new MMEvent("Level2PlayBegan"); 
myEvent.setStringForKey("Level1EndPoint", "Dungeon"); 
myEvent.setDurationForKey("Level1Time", new Double(3.25)); 
MMAnalyticsManager.sharedInstance().trackEvent(myEvent);

registerExceptionHandler

public void registerExceptionHandler()

This method sets the MMAnalyticsManager to handle uncaught exceptions running in the current application thread.

Since:
2.0



<< PREVIOUS PAGE: Activity Logging for Development

NEXT PAGE: MMEvent >>

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.