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

2012-08-28 Thread Andrea Corzani
Hello,
i'm also interested in this question.
I wrote into a MifareTag a new URI: http://developer.android.com/index.html 
using application NXPTagWriter.
My demo application activity has this intentFilter on Manifest:

intent-filter
action android:name=android.nfc.action.NDEF_DISCOVERED /
category android:name=android.intent.category.DEFAULT /
data android:scheme=http
android:host=developer.android.com
android:pathPrefix=/index.html /
/intent-filter

That should match with the URI on the tag.

Unfortunately, the android browser is always started instead my app.
Have you solved the problem?
Thanks

Andrea


Il giorno venerdì 10 febbraio 2012 17:38:54 UTC+1, NameZero912 ha scritto:

 Hi, 

 I'm wondering whether (with android 4.x) it is possible to change the 
 behavior that a detected tag that contains, say, 1 NDEF message with 1 
 record (URI http://...) automatically launches the browser. I'm 
 developing an application that is supposed to launch automatically 
 when a tag that contains a URL starting with a certain pattern (http:// 
 www.somedomain/*) is detected. Using foreground-dispatching does of 
 course work, but I'd also like my app to appear in the NFC activity 
 dialog chooser (which it does in v2.3.6, but in v4.x the browser is 
 always launched automatically). 

 Please also tell if there currently is no way of achieving this, so 
 that I can stop investigating.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

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

2012-02-11 Thread Michael Roland
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en