public class

ApplicationMetrics

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

Class Overview

ApplicationMetrics stores metric information about the application.

Summary

[Expand]
Inherited Fields
From class com.urbanairship.AirshipComponent
Public Methods
boolean getAppVersionUpdated()
Determines whether the app version has been updated.
long getCurrentAppVersion()
Gets the current app version.
long getLastOpenTimeMillis()
This method is deprecated. Will be removed in SDK 15.
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. Requires FEATURE_IN_APP_AUTOMATION or FEATURE_ANALYTICS to be enabled.

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

public long getCurrentAppVersion ()

Gets the current app version.

Returns
  • The current app version.

public long getLastOpenTimeMillis ()

This method is deprecated.
Will be removed in SDK 15.

Gets the time of the last open in milliseconds since January 1, 1970 00:00:00.0 UTC. Requires FEATURE_IN_APP_AUTOMATION or FEATURE_ANALYTICS to be enabled.

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.