NFC Emulation on android using Flutter - android

Been trying to create an NFC tag emulator for Android with flutter(Host Card Emulation)
But have been successful even after trying several different approaches .
Has any been able to get the NFC tag emulation on an android platform.?
The expectation is to use my mobile application for door access with emulated NFC tags instead of the standard RFID cards .
Tried a few times referring the flow from the links
https://pub.dev/documentation/nfc_emulator/latest/
https://www.zeromolecule.com/blog/host-card-emulation-hce-with-android-and-flutter/
Any guidance in the right direction or even better some sample code would be much appreciated .

Related

NFC device as a Reader for another Android HCE

I wanted to use my Android mobile as a reader to communicate to my android HCE(Host card EMulation) App. In internet I found the sample client application code for ACS Reader(PC Reader). Instead of that I would like to use my Android phone as a NFC Reader.
I found some sample for Mifare cards for Android, not for HCE communication
Please share If in case any sample code URL /API to help me for the same. Thank You
Not really sure what you are asking for, but here are two samples. One if for an Android NFC reader app and one is for an Android HCE app.
https://github.com/googlesamples/android-CardReader
https://github.com/googlesamples/android-CardEmulation
Please clarify your question if I did not understand you correctly.
CardReader
This sample demonstrates how to implement a low-level NFC card reader, for reading cards that do not contain NDEF or Android Beam data. This sample is designed to read the virtual loyalty card implemented in the CardEmulation sample.
In particular, this sample demonstrates how to disable Android Beam, select which AIDs the reader is interested in, and establish communication with the card. See Host-based Card Emulation for more information on the HCE APIs.
CardEmulation
This sample demonstrates how to emulate an NFC card, using the Host Card Emulation feature added in Android 4.4. This sample makes the device appear as a loyalty card whenever the screen is on and the user taps their device on an appropriately configured NFC reader.
The CardReader sample can be used to read the loyalty card implemented in this sample.
You can use an Android device (NFC+Kitkat onwards) in reader mode. Use NFCAdapter enableReaderMode function. This blog has complete sample.
Thanks
If I understand correclty your issue, you want to use one android device as an NFC reader to communicate with an HCE application installed on another android device. Am I right?
In this case, I do not think this is possible, because when you approach 2 NFC android devices, they will start to communicate in P2P.
In order to activate the CE mode on your "reading" device, you would need to deactivate the P2P feature, which is not possible if your phone is not rooted.

Reading EM4102 RFID tags on android

I'm exploring the possibilities of using the NFC Antenna on my Nexus 4 to read membership cards at work. The cards are an EM4102 RFID tag.
I found a small app called NFC Reader on the Android Market, but it doesn't react to the card, but it reads another tag (Mifare I think) perfectly fine.
Would this be a miss in the software, or is the antenna unable to read EM4102 tags?
I'm working on a small test app to see if I can get it working, but if anyone here has any experience with this, it'd be much appreciated!
I don't have experience with those tags, but a quick Google search suggests they are 125kHz technology. NFC only supports 13.56MHz technology.

Android NFC card emulation / use phone as card

I'm searching for a way to send specific commands from my phone to a reader.
I have already read that card emulation is not supported on android due to securtiy reasons, but it is possible via a firmware patch for android 2.3.4 on the Nexus S.
My main question is, do I really need card emulation to send defined APDUs to the reader and to recieve the answer APDUs or is there any other posibility maybe by misusing android Beam?
If I need to use card emulation are there any new insights?
The last posts, few posts I found are nearly one year old...
As adiditional information in the end I will not have any control over the reader.
Thanks for answering and on any new insights on card emulation.
It's possible in Android KitKat 4.4.
Check out this link, more information will be added soon I belive.
http://developer.android.com/guide/topics/connectivity/nfc/hce.html
What you are trying to achieve is somewhat candid. The reason smart cards are being used in NFC is because the NFC protocol is built in such a way that it is not possible to know the correct response in advance. There is always a secret involved, and you can't just guess it. Otherwise there would be a major security flaw in all the systems using contactless smartcards (building access control,
You can't just spy on the protocol, save the exchanges, and replicate them in some software, on most applications this will fail. There will be some random value at some stage, and some crypto computation to perform.
In order to emulate a card with the phone, you need a secure element (smartcard chip on the phone or the SIM card in your phone), and you need the NFC chip in your phone to route card emulation APDUs to this secure element (this is probably what the patch you are referring to is doing).
There are ways to do card emulation in an Android application, but I suspect this will require substantial patching, and you will not have predictible response time, so your reader might not like it. Also this will prevent card emulation from working when your phone is off (battery delpleted for instance).

NFC sample Application for Nexus S Emulator

I'm new to Android development. I am trying to Integrate NFC application on my Nexus S emulator which is installed in my windows machine. I am struggling a lot to develop the application for NFC demo. Can anyone give me the idea on how to crate the sample NFC demo application. My intention is that I need to get some output during the smart card swiped over my Nexus s mobile and I should read the Unique id from that smart card I swipe. Can anyone please help me in developing the application for this. Can you send me the application for this if you have.
Thanks in advance,
Dilip.
According to this
the Android emulator does not support NFC emulation
Also: There is some NFC example code here.

Getting started with nexus s NFC/RFID

Getting started with Nexus S NFC/RFID. Can anyone provide any guidance?
I'm interested in creating some home brew demos using the nexus s NFC/RFID hardware.
I think I need to find the appropriate tags and how to encode urls into tags that the nexus s can read by it's tags app.
Not sure about iso 14443 tags or mifare etc
Does nexus s support all of libnfc?
If I root the device can I get access to write functionality?
Thanks
The Nexus S will read Mifare tags. I have replayed YouTube videos (http://www.youtube.com/watch?v=eu7fQsPjDls) from a smartcard using the Nexus S. The URL was written with another device (Nokia 6212).
One possibility: I've noticed that the Nexus S can read RFID tags made by touchatag, an Alcatel-Lucent venture that has been around a couple years. They have a web page (google 'touchatag store') where you can order a "starter kit" of 10 tags plus a USB reader.
The tags are hard-coded to URLs at the touchatag mothership, www.ttag.be/[tagid]
So the idea is you register a tag through their web site, scanning it on the reader and associating a desired URL with it. When someone reads the tag with their phone, it will show up as www.ttag.be/[tagid] and from there it redirects to the desired URL.
I had answered this question partially in one of the Nexus S related questions.
Also, you can refer the developer.android.com URL for a demo app. I think, this uses dummy NFC tag.
If you are interested in developing some hardware demos then you need to buy a few actual NFC tags and try out the above app on your Nexus S phone device. I found a few sites (1, 2) who sell NFC tags, kits, etc. BTW, I have not tried any of these sites.
Based on what I came across, for now Nexus S provides only read functionality for NFC tags and support for other modes is planned.
EDIT:
Android blog states following are the new features in Android 2.3.3:
A comprehensive NFC reader/writer API that lets apps read and write to
almost any standard NFC tag in use
today.
Advanced Intent dispatching that gives apps more control over how/when
they are launched when an NFC tag
comes into range.
Some limited support for peer-to-peer connection with other NFC
devices.
I suggest you to but a reader/writer like ACR122U-A2 to read/write tag Topaz and Mifare Card.
In SmartId we are a pair of solution just developed with this twin.
http://www.youtube.com/watch?v=hYFwnc-apnI&feature=fvsr
If you have upgraded your Nexus to Android 4.0 then you might want to check out this Eclipse plugin (disclamer: shameless plug of own project). It uses Android NFC hardware and also supports a few NFC readers like the ACR122U.

Categories

Resources