I would like to track how much time take my app to start, but I would like to track this specific info defined here: https://developer.android.com/topic/performance/vitals/launch-time In order to have better graphics about it and add custom info to it. What I have tried?
I have tried to add a timer between onCreate
method and onResume
but the time obtained is the half of the time tracked by the system "Activity Manager: Displayed"
What can I do to have those values programmatically?
You should count the time between
Application.onCreate()
to end ofActivity.onCreate()
to get the cold startup time. Please read here for more info on this.Let me explain. In your application class:
In your launcher activity class, upon completion of onCreate method: