Reputation: 5325
I recently integrated Firebase perf sdk in my app.
As we know, it provides some out-of-the-box Automatic traces and one of them is app cold start up time.
So, it stops the trace when the first activity comes into view:
Starts when the app's FirebasePerfProvider ContentProvider completes its onCreate method and stops when the first activity's onResume() method is called.
In my app, the first activity is kind of splash screen and I don't really consider this to be my first activity since user can't do anything with it. It's just a placeholder where I decide what's the next main activity that I've to launch.
That's why, I want to modify this start up time measure OR if it's not possible to modify, create my own custom trace.
So, if it's possible to customize this measure, how do I do it?
And if I'd have to create my own trace, where do I start it? in Application's onCreate
? I'll be stopping it in my activity's onResume of course.
Upvotes: 1
Views: 777
Reputation: 317828
You'll need to create your own trace.
I suggest not using Application. Instead, take the same approach as the Firebase SDK and start a trace when a ContentProvider of your own creation has its onCreate called. Then stop the trace whenever you want.
Upvotes: 3