Thursday, September 15, 2011

Re: [android-developers] NFC application startup on Home screen

On Wed, Sep 14, 2011 at 5:03 PM, rapgaroo <hccaus@gmail.com> wrote:
> is there a way to start a specific application when tapping to a NFC
> tag without bringing out the default Tag application on the Android
> nor the app chooser?

Yes. You need the appropriate <intent-filter>. See:

https://github.com/commonsguy/cw-advandroid/tree/master/NFC/URLTagger

If you tap a tag that has the URL http://commonsware.com/nfctest, the
application will start up, courtesy of:

<intent-filter android:label="@string/app_name">
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<data android:scheme="http"
android:host="commonsware.com"
android:path="/nfctest"
/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books

--
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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate