Question

I would like to create a series of apps that will be opened via URL scheme. What I would like to do is to use the same base scheme for all of them but be able to specify which app to open... somthing like this:

  • myApp://open?appUrl="app1" -> open first app
  • myApp://open?appUrl="app2" -> open second app
  • etc...

Is it possible?

THX

Was it helpful?

Solution

You can do it using <intent-filter> in your <activity>:

 <activity android:name=".activity.Activity">
   <intent-filter>
     <action android:name="android.intent.action.VIEW" />
     <category android:name="android.intent.category.DEFAULT" />
     <category android:name="android.intent.category.BROWSABLE" />
     <data android:scheme="myApp" />
     <data android:host="app1" />
  </intent-filter>
 </activity> 

this should work for myApp://app1, I am not sure if intent-filter can parse more complicated URLs like open?appUrl="app1"

OTHER TIPS

Yes this is possible. You'll need to specify the URL scheme within the corresponding BroadcastReceiver of your apps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top