aspose file tools*
The moose likes Android and the fly likes NFC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "NFC" Watch "NFC" New topic
Author

NFC

Frank Daly
Ranch Hand

Joined: Mar 31, 2000
Posts: 139
I am interested in writing an app which uses NFC - does your book feature this technology?

Thanks,

Frank
D. Smith
Author
Greenhorn

Joined: Jan 11, 2013
Posts: 25
    
    5

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.


Android Recipes: A Problem Solution Approach: http://www.apress.com/9781430246145
Frank Daly
Ranch Hand

Joined: Mar 31, 2000
Posts: 139
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

Joined: Jan 11, 2013
Posts: 25
    
    5

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

Joined: Mar 31, 2000
Posts: 139
Many thanks again Dave
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: NFC