Is it possible to make a link such as:
<a href="anton://useful_info_for_anton_app">click me!</a>
cause my Anton app to start up?
I know that this works for the Android Market app with the market protocol, but can something similar be done with other apps?
Here is an example of a link that will start up the Android Market:
<a href="market://search?q=pname:com.nytimes.android">click me!</a>
Update:
The answer I accepted provided by eldarerathis works great, but I just want to mention that I had some trouble with the order of the subelements of the <intent-filter>
tag. I suggest you simply make another <intent-filter>
with the new subelements in that tag to avoid the problems I had. For instance my AndroidManifest.xml
looks like this:
<activity android:name=".AntonWorld"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="anton" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Try my simple trick:
and my html link:
or you can make < a href="classRegister:true" > <- "true" value for class filename
however this script work for mailto link :)
Once you have the intent and custom url scheme for your app set up, this javascript code at the top of a receiving page has worked for me on both iOS and Android:
This has only been tested on the Android browser. I am not sure about Firefox or Opera. The key is even though the Android browser will not throw a nice exception for you on
window.open(custom_url, '_blank')
, it will fail and returnnull
which you can test later.Update: using
store_loc = "https://play.google.com/store/apps/details?id=com.raditaz";
to link to Google Play on Android.