开发者

NFC tutorial for Android other than API demo

开发者 https://www.devze.com 2023-02-28 19:03 出处:网络
I\'m tooling around with my Nexus S and some MiFare tags and am trying to get together an application that simply reads and displays the ID of a tag.I\'ve looked through t开发者_C百科he API demo a few

I'm tooling around with my Nexus S and some MiFare tags and am trying to get together an application that simply reads and displays the ID of a tag. I've looked through t开发者_C百科he API demo a few times and can't quite get my head around it; I think this is so because the demo includes code for faking tags for developers who don't have access to a real device.

What I need is a tutorial or similar on how to code NFC-based apps for Android, ideally just the required imports and the method that will return the data from a scanned tag.

Does anyone know this off the top of their head?


Exactly for this.. I did some work.

http://mifareclassicdetectiononandroid.blogspot.com/2011/04/reading-mifare-classic-1k-from-android.html

Hope it helps.


I wrote an in-depth tutorial on how to get started with NFC here for people who are interested in learning how to integrate NFC with their Android app:

http://www.jessechen.net/blog/how-to-nfc-on-the-android-platform/


Here is some resources aimed at entry-level developers:

  1. An NFC boilerplate project for detecting, reading and writing NFC in Android.
  2. The NFC Eclipse plugin for a graphical NDEF editor.
  3. A workshop exercise taking in excess of 1 hour (includes solution)

(shameless plug ;-))

What many tutorials get wrong is that they handle NDEF messages in a low-level way. Rather go for a higher-level library like NDEF Tools for Android than messing around with byte arrays.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号