ParselyAndroid  2.2
The Parsely Android Toolkit
Public Member Functions | Static Public Member Functions | List of all members
com.parsely.parselyandroid.ParselyTracker Class Reference

Tracks Parse.ly app views in Android apps. More...

Public Member Functions

void trackURL (String url)
 Register a pageview event using a canonical URL. More...
 
void trackPostId (String pid)
 Register a pageview event using a CMS post identifier. More...
 
void setFlushTimer ()
 Allow Parsely to send pageview events. More...
 
boolean flushTimerIsActive ()
 Is the callback timer running. More...
 
void stopFlushTimer ()
 Disallow Parsely from sending pageview events. More...
 

Static Public Member Functions

static ParselyTracker sharedInstance ()
 Singleton instance accessor. Note: This must be called after sharedInstance(String, Context) More...
 
static ParselyTracker sharedInstance (String apikey, Context c)
 Singleton instance factory Note: this must be called before sharedInstance() More...
 
static ParselyTracker sharedInstance (String apikey, int flushInterval, Context c)
 Singleton instance factory Note: this must be called before sharedInstance() More...
 
static ParselyTracker sharedInstance (String apikey, int flushInterval, String urlref, Context c)
 Singleton instance factory Note: this must be called before sharedInstance() More...
 

Detailed Description

Tracks Parse.ly app views in Android apps.

Accessed as a singleton. Maintains a queue of pageview events in memory and periodically flushes the queue to the Parse.ly pixel proxy server.

Member Function Documentation

boolean com.parsely.parselyandroid.ParselyTracker.flushTimerIsActive ( )

Is the callback timer running.

Returns
true if the callback timer is currently running, false otherwise
void com.parsely.parselyandroid.ParselyTracker.setFlushTimer ( )

Allow Parsely to send pageview events.

Instantiates the callback timer responsible for flushing the events queue. Can be called before of after stop, but has no effect if used before instantiating the singleton

static ParselyTracker com.parsely.parselyandroid.ParselyTracker.sharedInstance ( )
static

Singleton instance accessor. Note: This must be called after sharedInstance(String, Context)

Returns
The singleton instance
static ParselyTracker com.parsely.parselyandroid.ParselyTracker.sharedInstance ( String  apikey,
Context  c 
)
static

Singleton instance factory Note: this must be called before sharedInstance()

Parameters
apikeyThe Parsely public API key (eg "samplesite.com")
cThe current Android application context
Returns
The singleton instance
static ParselyTracker com.parsely.parselyandroid.ParselyTracker.sharedInstance ( String  apikey,
int  flushInterval,
Context  c 
)
static

Singleton instance factory Note: this must be called before sharedInstance()

Parameters
apikeyThe Parsely public API key (eg "samplesite.com")
flushIntervalThe interval at which the events queue should flush, in seconds
cThe current Android application context
Returns
The singleton instance
static ParselyTracker com.parsely.parselyandroid.ParselyTracker.sharedInstance ( String  apikey,
int  flushInterval,
String  urlref,
Context  c 
)
static

Singleton instance factory Note: this must be called before sharedInstance()

Parameters
apikeyThe Parsely public API key (eg "samplesite.com")
flushIntervalThe interval at which the events queue should flush, in seconds
urlrefThe referrer string to send with pixel requests
cThe current Android application context
Returns
The singleton instance
void com.parsely.parselyandroid.ParselyTracker.stopFlushTimer ( )

Disallow Parsely from sending pageview events.

Invalidates the callback timer responsible for flushing the events queue. Can be called before or after start, but has no effect if used before instantiating the singleton

void com.parsely.parselyandroid.ParselyTracker.trackPostId ( String  pid)

Register a pageview event using a CMS post identifier.

Parameters
pidA string uniquely identifying this post. This must be unique within Parsely's database.
void com.parsely.parselyandroid.ParselyTracker.trackURL ( String  url)

Register a pageview event using a canonical URL.

Parameters
urlThe canonical URL of the article being tracked (eg: "http://samplesite.com/some-old/article.html")

The documentation for this class was generated from the following file: