How to Connect External NFC Card Reader to Tablet

2019-01-14 09:54发布

Right now I am having Tablet having OS Android 2.3.3 instead of NFC phone,so I need to connect External card reader to tablet.Please tell me which card reader should I prefer and any driver needed to connect card reader to tablet. The inbuilt NFC libraries support to that reader or not? thanks in advance.

8条回答
Rolldiameter
2楼-- · 2019-01-14 09:56

I found an answer,the ACS now provides android library and sample application for their readers.You can find library here and some information and video demo of android supported readers is here.

The only problem is that ACS android library supports only Android 3.1 and above. hope it will help you.

If you still have question feel free to ask..

查看更多
仙女界的扛把子
3楼-- · 2019-01-14 10:03

Hey sachin, Since your device doesn't have NFC, it won't have the NFC radio and hence it can not connect (Read or write) to an NFC card. According to the NFC lib, when ever you try to get NFCAdapter it will always return null. so you atleast need an nfc enabled android device for any experiment.

In my project, we used ACR122 smart card reader that will be connect to a pc not android device.This reader is used to read any nfc tag. An nfc enabled android device will act as a nfc tag in card emulation mode.

Now next part of question "The inbuilt NFC libraries support to that reader or not".

so this card reader can read card value.

查看更多
虎瘦雄心在
4楼-- · 2019-01-14 10:05

A little late to answer here, but I've actually tried to implement an external NFC reader as close to native NFC as possible.

It is possible to add an additional service, but the regular NFC initialization (NfcAdapter etc) will not be aware of this service, so it will have to be initialized in addition.

The result was that it is not technically possible to replace or add the built-in NFC service on a stock ROM - in a 'drop-in-replacement-way'.

Reusing some of the native NFC classes like Tag and IsoDep is possible.

However as a developer of an NFC app, you really do not want the same functionality from the external service as the built-in. The external reader probably has more functionality and at a very minimum you want to know whether the reader is plugged in or not.

See External NFC API for additional information (note: it is not a fully open source product).

查看更多
不美不萌又怎样
5楼-- · 2019-01-14 10:07

With a ACS NFC reader is it possible:

Here can you find the documentation for the libraries and example code. However it doesn't seem to have an option to write data. If you want to write to your NFC reader use the transmit function to send byte arrays.

private static final byte READ = (byte) 0x30;
private static final byte WRITE = (byte) 0xA2;

These bytes are the default read and write bytes for the transmit function. The full documentation of the default NFC protocol can be found here

example:

    byte[] response = new byte[300];
        int responseLength;
        try {
            responseLength = mReader.transmit(slotNum, command, command.length, response, response.length);
        } catch (ReaderException e) {
            e.printStackTrace();
            return "executeCommand: error: " + e.getMessage();
        }

Slotnum is the number of the reader you want to use. If I'm correct this is always 0 if you are using one reader/usbdevice.

example command:

new byte[] command {(byte) WRITE, 0x04, 0x06, 0x0a, 0x00, 0x21}

THE SECOND BYTE IS THE PAGE ADRES TO WRITE TO. Page 4 - 15 are writable (page 0 and 1 are the id, page 2 are lockbytes and page 3 are OTP. all of them are READ ONLY).

The Read function works the same as the WRITE function only send 3 times a 0x00 in the array for the correct read settings:

new byte[] command {(byte) READ, 0x04, 0x00, 0x00, 0x00}

THE SECOND BYTE IS THE PAGE ADRES TO READ.

查看更多
SAY GOODBYE
6楼-- · 2019-01-14 10:11

Neither Froyo 2.3 (min SDK version supporting NFC) or Ice Cream Sandwich 4.0 are compatible with a wide variety of chips.

When a manufacturer launch a new phone with a different NFC chip is because someone have created the drivers to use such chips and interface with Android's NFC classes, specifically the NfcManager class and the NfcAdapter class wich represents the local NFC adapter.

Best case scenario, you could use the Android NDK to create low level C/C++ classes to communicate somehow the External NFC Card reader with Android and then make more custom programming with the NDK to make the NfcAdapter on the SDK to detect it... and there are no warranties that you'll succeed.

And... if you are thinking about going to http://www.alibaba.com and import a tablet with NFC reader, think twice, because that ones might not allow you to do all what the NXP Semiconductors chip does with Android Beam (TM) such as Read/Write and support different I/O operations with NFC-A, B, F, V or ISO-DEP.

For your time's sake (and because time is the most valuable asset for anyone these days). I think your best option is to get a couple of NFC Phones such as the Galaxy Nexus S, DROID Razr, Xperia S, HTC Incredible, etc... those will work right out of the box, that's what we are doing.

查看更多
贼婆χ
7楼-- · 2019-01-14 10:13

Is this video answers to your problem : http://www.youtube.com/watch?v=6Xe7Ux0cTuI "Low cost , Simple , No driver - EM4100 or Mifare RFID reader for Ipad , Android and Windows"

PS: I doesn't work to this compagny and never try their solution.

查看更多
登录 后发表回答