Creating NFC Reader application
I want to develop a NFC tag reader application. I have some knowledge about the NFC API in the Android SDK. I have even imported the NFCDemo sample app from the Android SDK sample apps. The NFCDemo app just creates fake tags and capture them. I want to recognize NFC tags when they are tapped on the back of phone. I have a Google Nexus Pho开发者_C百科ne to test this.
My question is, when I tap a tag on the back of the phone, the "ACTION_TAG_DISCOVERED" intent is dispatched ... How and where this intent is to be handled? How is "ForegroundDispatch" used for the same?
Thanking in anticipation, Shivdattam.
Check TagViewer.java
class in NFCDemo
app (http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/TagViewer.html). It will give solution for your question.
It seems like your problem is "the Intent ACTION_TAG_DISCOVERED" is fired automatically or is to be fired by yourself after tag is touched on the back of your phone.Is it?
I have created an Android boilerplate project you might be interested in, it seems to cover what you are looking for.
精彩评论