Saturday, February 11, 2012

[android-developers] Re: NFC detection of tag with NDEF URL always launch browser

Hallo,

to get your app into the activity chooser for URLs you could possibly
use an intent filter that matches the one that is used by the web
browser: (I have no Android 4.0* at the moment, so I could not test
if this works.)
<intent-filter android:priority="-101">
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
</intent-filter>

If you want your app to always handle certain more specific URLs you
could use an intent filter like the following:
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" android:host="test.com"
android:pathPrefix="/nfctest/" />
</intent-filter>

br
Michael

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment