Open yogurtearl opened 3 months ago
Thanks @yogurtearl for the feature request - we discussed this (and other features based on new Android 15 APIs) and will likely implement this at some point.
How do you use ApplicationStartInfo ? I can't see any docs for how to get an instance of it
@AndroidDeveloperLB The ApplicationStartInfo
can be received by registering a ActivityManager.addApplicationStartInfoCompletionListener
hook, see the docs for more details.
@markushi Thank you! I can see detection of the reason of starting the app, but I can't find which app started it (when it's relevant). Is it possible?
@AndroidDeveloperLB I think what you're looking for is Activity.getReferrer
([link](https://developer.android.com/reference/android/app/Activity.html#getReferrer())). In which situations would this be useful for you?
@markushi Seems you are correct, but do I need to add visibility to the apps? I wonder if a simple launchable filter will be fine:
<intent>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent>
I think for most cases it should suffice. Anyway, thank you!
fwiw you can also retrieve it via getHistoricalProcessStartReasons, which would only return the app start infos for your app.
@romtsn What do you mean? What is "only return the app start infos for your app" ?
What's the difference between this and addApplicationStartInfoCompletionListener , if I check only the first item in the returned list? Or maybe it's for the previous starts of the app?
We'll investigate this more closely wrt which APIs make sense to use and what additional data they can provide. We'll follow up here
Problem Statement
Would like to have info provided in
ApplicationStartInfo
API on Android 15 available thru Sentry.see https://developer.android.com/about/versions/15/features#app-start-info
Solution Brainstorm
You can use this with
if( SDK >= 35 )
and still get useful data about application start up metrics for device running Android 15+.