public class

ApplicationMetrics

extends AirshipComponent
java.lang.Object
   ↳ com.urbanairship.AirshipComponent
     ↳ com.urbanairship.ApplicationMetrics

Class Overview

ApplicationMetrics stores metric information about the application.

Summary

Public Methods
boolean getAppVersionUpdated()
Determines whether the app version has been updated.
int getCurrentAppVersion()
Gets the current app version.
long getLastOpenTimeMillis()
Gets the time of the last open in milliseconds since January 1, 1970 00:00:00.0 UTC.
Protected Methods
void init()
Initialize the manager.
void tearDown()
Tear down the manager.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public boolean getAppVersionUpdated ()

Determines whether the app version has been updated.

Returns
  • true if the app version has been updated, otherwise false.

public int getCurrentAppVersion ()

Gets the current app version.

Returns
  • The current app version.

public long getLastOpenTimeMillis ()

Gets the time of the last open in milliseconds since January 1, 1970 00:00:00.0 UTC.

An application "open" is determined in Analytics by tracking activity start and stops. This ensures that background services or broadcast receivers do not affect this number. This number could be inaccurate if analytic instrumentation is missing for activities when running on Android ICS (4.0) or older.

Returns
  • The time in milliseconds of the last application open, or -1 if the last open has not been detected yet.

Protected Methods

protected void init ()

Initialize the manager. Called in UAirship during takeoff.

protected void tearDown ()

Tear down the manager. Called in UAirship during land.