I am creating an image viewer, and I want add an entry to “Hey my dear user, please set this app as your default image viewer” in my app.
So, I need my app has SET_PREFERRED_APPLICATIONS permission granted. But sadly, as the doc said, this field is deprecated and no longer useful, not effective at all when I add <user-permission android:name="android.permission.SET_PERFERRED_APPLICATIONS" /> to the AndroidMenifest.xml.
But the doc doesn’t point out the alternative. Could anybody tell me how may I make that? TIA.
The point of deprecating that permission may have been to give the user full control. They will have the option of setting your app as a preferred one themselves and you can, of course, encourage them to do so, e.g. in the welcome screen if you have one. I don’t think you can do what you’re looking for but wouldn’t worry about that. If your app does what it should well, users will set it as the preferred one.