com.google.analytics.tracking.android
Class GAServiceManager

java.lang.Object
  extended by com.google.analytics.tracking.android.GAServiceManager
All Implemented Interfaces:
ServiceManager

public class GAServiceManager
extends java.lang.Object
implements ServiceManager

This class manages the service side of the Google Analytics SDK. Its responsibilities include managing the AnalyticsStore and controlling dispatch.

Sample calls:

   GAServiceManager.getInstance().dispatch();
   GAServiceManager.getInstance().setDispatchPeriod(180);


Method Summary
 void dispatch()
          Dispatches queued hits (view, events, or transactions) to Google Analytics if a network connection is available.
static GAServiceManager getInstance()
           
 void setDispatchPeriod(int dispatchPeriodInSeconds)
          Sets dispatch period for the dispatcher.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static GAServiceManager getInstance()

dispatch

public void dispatch()
Description copied from interface: ServiceManager
Dispatches queued hits (view, events, or transactions) to Google Analytics if a network connection is available.

Specified by:
dispatch in interface ServiceManager

setDispatchPeriod

public void setDispatchPeriod(int dispatchPeriodInSeconds)
Description copied from interface: ServiceManager
Sets dispatch period for the dispatcher. The dispatcher will check for hits to dispatch every dispatchPeriod seconds. If a negative dispatch period is given, automatic dispatch will not be enabled, and the application will need to dispatch events manually using ServiceManager.dispatch(). If zero, dispatching will happen on every hit.

Specified by:
setDispatchPeriod in interface ServiceManager
Parameters:
dispatchPeriodInSeconds - the new dispatch period