Android NFC with USB-NFC-Reader

13,842

Is it somehow possible, to use the built-in NFC-functions from Android with the external USB reader?

No, that's not possible. If your Android devices did not ship with NFC, there simply is no built-in NFC functionality (not even on the software side). The Android NFC API is essentially an empty stub implementation that does nothing on such a device.

Is there another library for this reader, that supports peer-to-peer communication with other NFC-devices?

The library from ACS does not prevent you from accessing the reader's peer-to-peer capabilities, so I don't see why you would want to use a different library. See section 5.9 of the API specification on how to use the reader's peer-to-peer capabilities.

I need to transfer files from my Android 4.2 tablet to other Android NFC devices

Based on that request I assume that you want to use something like Android Beam to establish some fast out-of-band channel over NFC and then transfer the (large?) files over that out-of-band channel (e.g. WiFi or Bluetooth).

In that case, you would need to re-implement the Android Beam stack (NFC peer-to-peer mode + LLCP + Simple NDEF Exchange Protocol + establishing out-of-band communication channel + transfering file over that channel)

Share:
13,842
Michael B
Author by

Michael B

Updated on July 24, 2022

Comments

  • Michael B
    Michael B almost 2 years

    I have an Android tablet with Android 4.2. This tablet does not have NFC hardware. However I have an external USB reader: ACR 1252U, that came with an Android library. This library unfortunately only gives me basic functionality - read and write Tags. Altough this is working quite well, it is not enough...

    Because for my application I need to transfer files from my Android 4.2 tablet to other NFC devices (Android smartphones). So I need to put the NFC reader into peer-to-peer mode - which it supports. But how can I achive this with my setup? There indeed is an SDK for that reader, but it's Windows only.

    • Is it somehow possible, to use the built-in NFC-functions from Android with the external USB reader?
    • Is there another library for this reader, that supports peer-to-peer communication with other NFC-devices?
    • Is there another Hardware that I can use, to make this work?

    Edit: The linked question does NOT solve my problem:

    1. It is 3.5 years old. On might think, that in meantime has changed a lot.
    2. The answer to that question (= use the Android ACS library), is part of my own question... So it can't be the answer.
  • Michael B
    Michael B over 8 years
    Thank you! My goal is to send data to another Android phone, but without using Bluetooth or WiFi. Since the data is very small (~20kb) and the NFC transfer rate is 424 kbit/s (=53kB/s), this should be theoretically possible, what do you think?
  • Michael Roland
    Michael Roland over 8 years
    Yes, that should be possible. I suggest that you check if the reader supports card emulation mode (then the second device could simply access it as if it was an NFC tag). Else, you might want to use the reader in reader mode and use HCE mode on the second device.
  • Michael B
    Michael B over 8 years
    I followed your advice, and checked the readers card emulation mode. Unfortunately I'm not able to write the data to the emulated tag correctly. Can you help me with that question, too? ;) stackoverflow.com/questions/33695891/…