Skip to content

Android session monitoring

Session monitoring counts the sessions of your Android app and measures how long each one lasts in the foreground. The Appelium Dashboard uses these sessions for session duration, the adoption of each release and the crash-free session rate behind release rollout health. Sessions and active devices shows what these sessions tell you about your audience: daily, weekly and monthly active devices, stickiness and the spread of session lengths.

Enable session monitoring

Enable it together with crash reporting, to see crash-free sessions:

AppeliumFeedback.start(
    apiKey = "YOUR_API_KEY",
    application = this,
    crashReporting = CrashReportingConfiguration.Enabled,
    sessionMonitoring = SessionMonitoringConfiguration.Enabled
)

How sessions are measured

stateDiagram-v2
    direction LR
    [*] --> Foreground: user opens the app
    Foreground --> Background: user leaves the app
    Background --> Foreground: user returns
    Background --> [*]: process ends
    note right of Foreground: counts towards session duration
  • A session starts when the app comes to the foreground and ends when it moves to the background.
  • Only time in the foreground counts towards session duration. Background starts of the process, for example for a push notification, a job or a broadcast, and time spent in the background do not.
  • Other enabled features, such as crash or error reporting, still collect their data in the background.
  • Session data is uploaded when the app moves to the background, or on the next launch if the process ended first.

What is collected

Each session contains:

  • its start time and foreground duration;
  • for the session in which the user launched the app, the launch duration until the first frame, like the App Start trace;
  • the app version, Android version, device model and locale;
  • average CPU and memory usage;
  • the user identifier and backend environment, if set;
  • a random identifier that the SDK generates when the app first starts it, used to count devices. It is not the Android ID or the advertising ID.

Sessions do not contain screens, user input or logs.

When sessions are not recorded

To keep your metrics representative, sessions are not recorded:

  • on an emulator;
  • while a debugger is attached;
  • while the app is being tested with Appelium Tests.

Test session monitoring on a device, with the app opened from its launcher icon rather than from Android Studio.