0
我正在研究一個需要讀取RFID標籤的應用程序。請告訴我,Android設備支持哪些RFID標籤,是否需要額外的硬件或其他東西來讀取RFID標籤,或者只能通過NFC進行。我做就可以[R & d我知道的話,可以通過讀取NFC RFID標籤和使用我開發者網站integerated的代碼,但我不能能夠讀取(用於考勤RFID標籤)的RFID標籤使用NFC讀取RFID標籤
public class NFCForegroundUtil {
private NfcAdapter nfc;
private Activity activity;
private IntentFilter intentFiltersArray[];
private PendingIntent intent;
private String techListsArray[][];
public NFCForegroundUtil(Activity activity) {
super();
this.activity = activity;
nfc = NfcAdapter.getDefaultAdapter(activity.getApplicationContext());
intent = PendingIntent.getActivity(activity, 0, new Intent(activity,
activity.getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
IntentFilter ndef = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED);
try {
ndef.addDataType("*/*");
} catch (IntentFilter.MalformedMimeTypeException e) {
throw new RuntimeException("Unable to speciy */* Mime Type", e);
}
intentFiltersArray = new IntentFilter[] { ndef };
techListsArray = new String[][] { new String[] {IsoDep.class.getName(),NfcV.class.getName(), NfcA.class.getName(), NfcB.class.getName(), NfcF.class.getName(), Ndef.class.getName(), NdefFormatable.class.getName(), MifareClassic.class.getName(), MifareUltralight.class.getName()} };
}
public void enableForeground()
{
Log.d("demo", "Foreground NFC dispatch enabled");
nfc.enableForegroundDispatch(
activity, intent, intentFiltersArray, techListsArray);
}
public void disableForeground()
{
Log.d("demo", "Foreground NFC dispatch disabled");
nfc.disableForegroundDispatch(activity);
}
public NfcAdapter getNfc() {
return nfc;
}
}