Measure SDK captures lifecycle and navigation events automatically, this includes the following:
Measure automatically tracks when the application has come to foreground (is visible to the user) and when it has been put into background (is no longer visible to the user).
To detect when an Application goes to background, Measure
registers
tp Application.ActivityLifecycleCallbacks
callback and checks when the last Activity on the stack receives an onStop
event, effectively meaning the app is no
longer visible to the user.
Similarly, to detect when an Application comes back to foreground, Measure relies on the same callbacks to check when
the first Activity on the stack receives an onStart
event, effectively meaning the app is now visible to the user.
Checkout all the data collected for application lifecycle in the App Lifecycle Event section. section.
Measure automatically tracks the following Activity lifecycle events:
Similar to Application lifecycle, Measure registers ActivityLifecycleCallbacks and tracks the lifecycle events of each Activity.
Checkout all the data collected for Activity lifecycle in the Activity Lifecycle Event section.
Measure automatically tracks the following Fragment lifecycle events:
Measure
registers FragmentLifecycleCallbacks
to track the lifecycle events of each Fragment. This is only done if androidx.Fragment
dependency is added to the
project.
Checkout all the data collected for Fragment lifecycle in the Fragment Lifecycle Event section.
Note
Measure supports androidx.Fragment lifecycle events only, the legacy android.app.Fragment is not supported. The Fragment lifecycle events are only tracked if the androidx.Fragment dependency is added to the app. Measure does not introduce any dependency on androidx.Fragment automatically.
Measure instruments the AndroidX navigation library using ASM by automatically tracking all screen view events by registering NavController.OnDestinationChangedListener This is done using the Measure gradle plugin, read more details about it here.
Checkout all the data collected for screen view in the Screen View Event section.
Note
Compose navigation events are only tracked if the project uses Compose and the Compose navigation library. Measure does not introduce any dependency on Compose navigation library automatically.