Take the 2-minute tour ×

Say I want to define that an URI such as:


must be handled by my own application, or service. Notice that the scheme is "myapp" and not "http", or "ftp". That is precisely what I intend: to define my own URI schema globally for the Android OS. Is this possible?

This is somewhat analogous to what some programs already do on, e.g., Windows systems, such as Skype (skype://) or any torrent downloader program (torrent://).

share|improve this question
Duplicate –  Casebash May 11 '10 at 4:00
Actually hackbod, its recommended for android link that you don't use a standard schema. –  Brill Pappin May 29 '11 at 2:29
add comment

2 Answers

up vote 59 down vote accepted

This is very possible; you define the URI scheme in your AndroidManifest.xml, using the <data> element. You setup an intent filter with the <data> element filled out, and you'll be able to create your own scheme. (More on intent filters and intent resolution here.)

Here's a short example:

<activity android:name=".MyUriActivity">
        <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" android:host="path" />

As per how implicit intents work, you need to define at least one action and one category as well; here I picked VIEW as the action (though it could be anything), and made sure to add the DEFAULT category (as this is required for all implicit intents). Also notice how I added the category BROWSABLE - this is not necessary, but it will allow your URIs to be openable from the browser (a nifty feature).

share|improve this answer
It took me a while to figure out that to link to a specific path that the "android:path" variable has to specify everything after the protocol, ie. it must be of the form "youtube.com/myvideo" –  Casebash May 13 '10 at 23:14
Thank you, I will. –  ninetwozero Aug 13 '11 at 11:31
Works great but how can I read the value of the GET parameter "d" given in the url from MyUriActivity? –  Timo Jun 12 '13 at 10:56
add comment

I strongly recommend that you not define your own scheme. This goes against the web standards for URI schemes, which attempts to rigidly control those names for good reason -- to avoid name conflicts between different entities. Once you put a link to your scheme on a web site, you have put that little name into entire the entire Internet's namespace, and should be following those standards.

If you just want to be able to have a link to your own app, I recommend you follow the approach I described here:


share|improve this answer
Thanks for the heads up, but I'll be only using this to try to prove a concept, in a closed environment. Should this experiment ever leave its testing phase, I'll definitely consider ratifying the whole deal. –  punnie Mar 16 '10 at 16:16
Okay... but why not just do the right thing? It's not any significant more work. –  hackbod Mar 16 '10 at 18:03
Youtube do what @hackbod is suggesting, but opening Youtube links from facebook opens the browser and not the Youtube app. Is this mechanism too "delicate"? –  kilaka Apr 4 '12 at 9:56
I'm leaning towards defining my own scheme so that I can use the same web logic to launch either my iOS app OR my Android app. Just my 2 cents –  bababooey Oct 10 '13 at 23:08
add comment

Your Answer


