aveschini
aveschini

Reputation: 1712

Android Custom URL Scheme for different apps

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:

Is it possible?

THX

Upvotes: 0

Views: 479

Answers (2)

marcinj
marcinj

Reputation: 49986

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"

Upvotes: 1

Ben Weiss
Ben Weiss

Reputation: 17922

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

Upvotes: 0

Related Questions