Is it possible today, without hacks, to emulate an NFC card with NFC-enabled Android devices?
The target use case is for people to identify themselves through their mobile phone instead of their NFC member cards. The TagID can be different from existing cards TagIDs but has to stay unique per device, and shouldn't change after the first use.
Multiple similar questions exist but no answers were recent and/or straightforward.
Thanks!
Yes, with recent good news from Android 4.4.
http://developer.android.com/guide/topics/connectivity/nfc/hce.html
Related
Can anyone tell me whether it is possible to write to the NFC tag in a smartphone?
I know that's not the usual application and I could write the (small amount of) data to an app on the phone as well but I'd like to implement this in a way that doesn't require an app installed on the phone.
I have read answers to some more application-specific questions here regarding the use of a (specific) smartphone as an NFC tag, but I have a very limited understanding of RFID technology in smartphones and none of these answers have helped me answer my very simple question.
For my application I'd need to be able to write the data to any smartphone, or at least the majority of devices currently in use, without the "active participation" of any SW on the phone.
So if anyone could tell me whether or not this is even possible, I'd greatly appreciate that :) Thanks for any input!
Android smartphones any developer make the phone behave like a Type 4 NFC tag with host card emulation.
With iOS only Apple can make the phone behave like an NFC Tag (with Apple Wallet)
So what you want is not really possible.
You might be achieve what you want with something like PassKit https://passkit.com/ as that allows you to store "passes" in Google and Apple wallets which have NFC capability.
Though you might be better of with QR code as they can be read on all devices with the camera and show on screen by your apps.
I want to find out if this is possible, to have a web app read off information from a Mifare card, by tapping the card against a NFC-enabled Android device.
I have been searching this for quite some time, and it seems like as of now it's only limited to experimental implementation - https://whatwebcando.today/nfc.html
Or am I truly better off with a native Android app?
Edit:
Thanks to all who replied. We have been trying out the Web NFC API as specified here https://w3c.github.io/web-nfc/, turned on the experimental features of Chrome on the Android device, but it always return a null value when we tap the Mifare card on the device. Are we missing out any steps, or is it really a technical limitation of the API at this moment, since it's still not considered as a stable specification?
I think on mid-term even WebNFC will be restricted to (reading & writing) NDEF messages, similar to what Apple is currently doing on iOS.
So if you want to read info like UID or raw data out of a MIFARE card, you need to write a native app. Be aware that MIFARE (Classic) is not supported by all phones, even when they have NFC.
If you want to use a framework like ionic or Cordova, you can also use the NDEF plugin (https://github.com/chariotsolutions/phonegap-nfc)
So iv been editing and working with NTAG215 type NFC tags and writing data to them etc. Would it be possible to use an android as a tag and have it be read by a different system, for example a WiiU or Switch. Host Card Emulation?
Yes, and no. I'm assuming you want to use your android to emulate an Amiibo, so here is what I found out.
The problem with Android's Host Card Emulation (HCE) is that it supports ISO 14443-4 for NFC tag emulation and the Amiibo/NTAG215 is an older version of this ISO (14443-2). So no for Android, unless your phone is rooted and you somehow go around this restriction. This guy apparently has some good insights on the issue you are having.
However, it turns out you can do this by using some older version of Cyanogen Mod. I did not find the any code for this because of copyright infringement. So be mindful of that when you code your app and share it.
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).
I´ve been reading a lot about NFC, card emulation and etc.... I found two very helpful posts about this issue:
Android and Symbian NFC mobile development questions and answers (FAQ)
http://forum.xda-developers.com/showthread.php?t=1281946
Reading them I realized that it is quite complicated to write an application to make a payment.
Since I just want to see "something" working I'd like to ask the more experienced people if using the patch provided at xda-developers forum (second link above) would be enough just to write an appication that would open some door ou register/authorize someone´s entrance at an event (provided that I have a NFC device to properly interact with my phone, of course).
Thank you all
Payment is mostly impossible since you don't have the keys for the JavaCard card manager, better forget about it. Additionally, to write a Visa, etc compatible payment applet, you
need access to their specs, which means signing NDAs, paying money, etc.
Apparently the Mifare chip has stock keys, so you can modify it. So if you have a reader, and a device (door, etc.) that uses Mifare cards, you might be able to get it work. The thread also mentions that you might be able to clone your transport card. But:
you need to build your own firmware and flash it on a rooted phone
you may need to port the patches to whatever is the current GB version (2.3.7) or use exactly the same (old) tag
You need to do a lot more reading :)
In my opinion, you shouldn't bother with trying the patches on XDA Developers, especially if you are considering using Android 4.0 ICS. Android 4.0 already has built-in functionality on the Nexus S and Galaxy Nexus phones to enable card emulation. Drawback: you need a rooted phone to make it all work (see e.g. How to obtain NFCEE_ADMIN permission on rooted phone? for an example of someone succeeding).
A perhaps simpler approach is using NFC peer-to-peer communication ("Android Beam") with an external reader. This can work with any Android NFC device using a simple app to push the necessary data to the reader. Provided the reader support peer-to-peer communication, this is far the easiest solution. It would require some development work on the reader side, though, see http://code.google.com/p/ismb-npp-java/wiki/NppFromPhoneToACR122 for an example of this approach.