Apparently if you have a rooted phone, you can make use of com.android.nfc_extras to gain access to features such as card emulation ( Secure element Access Control on ICS 4.0.4 ).
I know that this is an unofficial API, but is there any documentation for it (official or unofficial)? Or on the other hand, is card emulation far more complicated than I've realised?
Keep in mind that accessing the secure element and doing card emulation are actually two different things. The secure element is essentially closed; you cannot modify it. Using com.android.nfc_extras you can turn card emulation through the secure element on or off. That's it.
You can send APDUs to the secure element from your app, like communicating with an IsoDep tag (in the lower level part of the NFC stack both use the same code path). See for example http://nelenkov.blogspot.nl/2012/08/accessing-embedded-secure-element-in.html for a good explanation how to do it.
There is no documentation. If you want to dig into this API I suggest that you look directly at the source-code. It is not much, just two files that implement and define the API. You can get a copy for example here:
http://source-android.frandroid.com/frameworks/base/nfc-extras/java/com/android/nfc_extras/
In the API you will find concepts like ExecutionEnvironment, Routes etc. Don't let these concepts confuse you. In the end all you can do with the NfcExtras interface is to:
Turn on card emulation by setting a route created with the ROUTE_ON_WHEN_SCREEN_ON.
Turn off card emulation by setting the 'off' route.
Exchange data with the embedded secure element.
That's it! All the rest is just API sugar to make things look bigger than it really is.
Some additional caveats:
If you want to call the functions you need your application to be white-listed in the nfcee_access.xml file locates in /etc. If you don't white-list yourself you'll get an access violation exception.
There is no way for you to distinguish between the embedded secure element or the NFC capable UICC present in the phone.
There is no way to talk to the NFC capable UICC in the phone. You can only talk to the embedded secure element (aka the SmartMX chip for phones with NXP chipset). Communication to the UICC itself is only possible through the RID interface via the ISO7816 interface, and this is - if possible at all - proprietary.
Last but not least: There is no guarantee that the NfcExtras interface does anything at all. The interface is used by Google Wallet, but the mobile payment market is segmented and everyone cooks his own soup.
I know about at least one big mobile payment provider that completely ignores the NfcExtras interface, disabled it and uses his own, hidden mechanism to turn things on and off.
Related
I have locked a NFC tag using makeReadyOnly() using specific app and now I want to rewrite tag only from that specific app.
I have followed these documentation
https://developer.android.com/reference/android/nfc/tech/Ndef#makeReadOnly()
I know NFC bits are permanently locked and cant be reverted. I will appreciate any possible workaround or trick to get my job done. Like Retag does using id technique although I didn't apply this.
If you want to make a Tag that is readOnly to everything except your App then most Tags offer password protecting the write operation, BUT how to do this is usually specific to the make and model of the Tag's you are using.
So you don't specify the make and model of the Tag you are using it it hard to help in detail, just checkout the datasheet for your Tag.
This particular Tag is probably not writable to any more but some Tag's (Ones not NFC specification compliant), might not implement this readonly protection in hardware, so it might be possible to use low level API's to change other data on the card, bypassing the checks in the NDdef implementation - I've seen one Tag at least where this is possible.
I've done some research into creating a simple app that could act as a Bluetooth input device, and discarded the project after finding that it would not currently be possible to use the human interface device profile without rooting the device.
However, is it possible that there is a workaround for this in direct assembly code? This may be a stupid question, and I understand that there may not be any relevant documentation even if it is possible.
But as I understand it, one should be able to access and modify RAM data directly with assembly. If you knew what to change, could you edit the signal to use a different profile?
I want to develop an app that makes use of the WiFi interface to establish cooperation amongst a subset of mobile devices, which will then allow me to exploit location information and achieve higher energy efficiency (cluster based communications).
For security reasons, I must append a digital signature (or a keyed hash) at the end of specific WiFi frames (e.g. when ARP protocol runs).
Is it possible to achieve this in Android OS?
Will I be able to update the WiFi protocol stack in Android?
Will it be feasible?
Any literature suggestions?
I'd be grateful for any directions.
Is it possible to achieve this in Android OS?
I think you would need some kind of raw sockets. For that you can look to Raw Sockets on Android
Will I be able to update the WiFi protocol stack in Android?
Android is open source so you can try to modify it and load another Android firmware to your phone. For example, you have custom firmware versiones like the one you find at http://www.cyanogenmod.com/
Will it be feasible?
In my opinion it is possible but very difficult. Probably you can find a more feasible solution for your problem.
Any literature suggestions?
You can read this threat about how to download and edit Android source code: http://groups.google.com/group/android-kernel/browse_thread/thread/6e428031c5e70417/8d99386a62f7d75e?pli=1
Good luck.
I'm thinking of starting a project for a local University where we would use NFC to read tags along all the campus with specific information. For example: if a user owns a NFC enabled phone, he could use it to grab additional information when walking through important parts of the library, or auditorium, etc. So he could get contact numbers, attention schedules, and even we would like to show him some 3D models using AR when reading the correct information tag.
Which technologies would be required to create a program for doing this? Android would be our first option since the Google Nexus S is the only cellphone that has NFC. But also what about the tags? Are there any places where I could buy them, and then how could we load information inside the tag?
Also for the Augmented reality in iPhone there are libraries like ARToolkit, so here again guess we would need to use the Android NDK to use it. However if there are any libraries for AR written in Java that would be better.
Anyway if I'm missing some point or ignoring an important technology I should consider when planning the project, would be great to hear about it.
Thanks a lot.
NFC technology is an application of RFID so provided the phone could be set to reader mode then all you'd need is passive RFID tags placed at various points. You could easily use Phidgets for the RFID tags.
http://www.phidgets.com/products.php?category=14
As for AR toolkits there are several ones used for Android. Some using NDK and others in Java.
http://www.arvertising.com/news/2009/11/nyartoolkit-for-android-en/
http://developer.qualcomm.com/dev/augmented-reality
http://www.slashgear.com/qualcomm-augmented-reality-sdk-for-android-released-04105775/
The NXP TagWriter application makes it possible to write NFC tags with one's Android phone. The standard tag reader application makes it possible to read NFC tags and launch URLs stored on them. If you want to roll your own app, the android.nfc package has the various bits you need for reading tags.
There is already a StackOverflow question for where to buy NFC tags, although there aren't very many answers there. A Google search for "create NFC tag" or "buy NFC tag" will give a handful of sources.
I don't know is this the right place to ask. Because I need to know the concept about NFC. From the Android 2.3 Platform reference. And i googled it. But i didn't get the correct concept. Can anyone please provide me good links and tutorials for that. And how to implement it in android.
NFC = Near Field Communication
By using NFC tags you are able to scan these tags and retrieve information from the tag. This enables you to enhance physical objects with digital data. F.ex. posters can have a NFC tag and when you scan this tag with your NFC enabled mobile phone you can get some relevant information from the poster
There is a longer and better explanation on http://en.wikipedia.org/wiki/Near_field_communication and there are also examples of use..
Additionally the Android SDK contains a NFC demo project.. take a look at it to see how it is implemented
You can imagine it as bluetooth with a very close field.
NFC is a radio communications technology which works on an effective range of 4 cm. It is used to exchange small amounts or data (or settings up longer session) between devices in the implicit context of close proximity (and thus trusted parties). Passive tags can also be used.
After investigating NFC for about one month, my current impression is that NFC should be supported by most mobile applications, if only to share data with other devices. For example, a mobile web browser would share the link of the currently viewed page if an NFC session is initiated.
I have created an NFC Eclipse plugin if you would like to get started with some passive tags experimentation, it comes with a corresponding (free) Android app which does the actual NFC interfacing. I also recommend reading this guide from Android.
Edit: Plugin now also supports some card readers :-)