This has been used in Android since 1.0 by apps like Market, YouTube, and Gmail to allow the user to select to go to the app which clicking a link from the browser. The sample code I showed is the actual code in Market. This definitely does work, on every version of Android.
Re: using custom schemes -- it is fundamentally broken to randomly define new schemes that appear on web pages, because schemes are a universal namespace so it is extremely easy to have conflicting schemes with had results. This is why on Android we strongly recommend intercepting URIs based on real web site URIs. This also allows decent graceful fallback for the case where there is not an app that knows how to intercept the URI -- the URI can still be shown as an actual web page, with whatever you want including instructions on how to download and install your app. If iOS doesn't support this... well, I can't make them allow for a non-broken way to do this. :} Android *does* allow you to intercept just by scheme, we just discourage this because it is fundamentally flawed. On Mon, May 2, 2011 at 11:25 AM, andrew <[email protected]> wrote: > Hi Diane, > > I just wanted to confirm what you are saying, as I have read this can > be done, then fought with it not working (has this been "fixed" to not > work in newer releases of the Android SDK??), and after searching for > solutions I see lots of posts from other people trying to do this, > that is: define our own custom scheme so we can send emails and html > pages that cause the app to open.... > > I *suspect* I have seen (older?) Android documentation/examples that > suggests doing it, but as I don't have a solid reference handy I won't > insist on that point. > > Just found this on my machine, under android API level 9 and level API > samples.... Android wicktionary sample code... > /android-sdk-mac_86/docs/resources/samples/Wiktionary/ > AndroidManifest.html > <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="wiktionary" > android:host="lookup" /> > </intent-filter> > > > > Please DO NOT use your own scheme. That is > "yourapplication://doaction?parameters" is wrong. > > We are trying to send emails to users with links that can cause the > app to be opened on Android AND iPhone, but it seems iPhone protects > the existing schemes and limits them to the built-in apps and does not > allow us to specify a url filter for the http scheme..... so there is > no way to specify a link that will work on both platforms? > > Aaaarrrggg.... > > Andrew > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

