Android Question Defaul app

LucaMs

Expert
Licensed User
Longtime User
Someone asked me a question that I can not answer, so I reply here (it was on the Italian Forum).

Is there a way to set an app (of course that we developed) as the "default app" for a specific "service" (Intent)?

What they would want to get, then, is what you get in Windows with double-click on a specific file type: "Open" instead of "Open with..."
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Only the user can set the default app. You can however use an intent filter to tell the OS that your app supports a specific intent and should appear in the list of relevant apps.

This example shows how you can catch SMS messages with a service: Intent Filters - Intercepting SMS messages in the background

There are other intents that work with activities instead. Activity.GetStartingIntent will return the intent that caused the activity to be resumed.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Only the user can set the default app. You can however use an intent filter to tell the OS that your app supports a specific intent and should appear in the list of relevant apps.

This example shows how you can catch SMS messages with a service: Intent Filters - Intercepting SMS messages in the background

There are other intents that work with activities instead. Activity.GetStartingIntent will return the intent that caused the activity to be resumed.


I know that thread and I imagined that it was impossible to "pretend" to set our app as the default.

I'll post that link and this one, as a response.

Thank you, Erel
 
Upvote 0
Top