Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NFC

 
Frank Daly
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am interested in writing an app which uses NFC - does your book feature this technology?

Thanks,

Frank
 
D. Smith
Author
Greenhorn
Posts: 25
5
Android IntelliJ IDE Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frank -

Yes, the basics of NFC communication between two Android devices is covered. There are two primary ways to transmit data, using the basic NDEF push mechanism (this is how you read tags and has been around since Android 2.3) or the newer "Android Beam" APIs. The Beam APIs are more used for sharing data between two devices, and allows the process to start over NFC, but complete over Bluetooth or WiFi Direct. This allows you to share larger files like media between two devices, which would not really be possible to transmit completely over an NFC channel.
 
Frank Daly
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much Dave. If I don't win a book in this competition I'll definitely buy your book. I'm hoping to also write an application using NFC to read a MiFare classic chip. I've googled this and have come up with some useful links but none that i've managed to successfully implement in my own application - have you any advice for writing such an application?

Frank
 
D. Smith
Author
Greenhorn
Posts: 25
5
Android IntelliJ IDE Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frank -

I think one key to remember is that the Android Tag Dispatch system really only supports the NDEF data format when working with smart tags. So it's not entirely specific to the fact that the tag hardware be compatible with Android as the data you write to the tag be in the correct format. The MiFARE Classic is made by NXP, and NXP also has an app on Google Play that you can use to ensure you write proper data to your tags. So I would make sure you have that application to begin playing around with your tag before writing any code: https://play.google.com/store/apps/details?id=com.nxp.nfc.tagwriter

The second piece of information I would point you to would be the Android documentation on the Tag Dispatch System, which will hopefully provide some more context from the framework about how to parse and interact with the NDEF records on your tags. This should provide some more detail about how your application needs to register with the systems so that it knows to forward the data found on certain NFC tags to your application for processing: https://developer.android.com/guide/topics/connectivity/nfc/nfc.html#tag-dispatch
 
Frank Daly
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many thanks again Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic