android read back the tag infomation after write, without second touch of tag

余生长醉 提交于 2019-12-24 06:44:22

问题


I want to develop an android program that write to the payload of an nfc tag,then read back the tag information after writing command to verify the writing. However, It seems like it need to remove and re-enter the tag to the NFC field to refresh the intent in order to read back writing information. Is that possible to implement that within one touch?

Or anyone knows the detail process in background that explain why I need second touch to read back? As far as I know, android devices are querying for NFC tags when the screen is unlocked, does that mean it will keep reading tag in the NFC field?

Thanks in advance!


回答1:


There is no need for a second touch. When writeNdefMessage() does not throw any exception, the writing was successful. If you really want to check the result, you can call getNdefMessage() to read the current contents from the tag.



来源:https://stackoverflow.com/questions/12150062/android-read-back-the-tag-infomation-after-write-without-second-touch-of-tag

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!