我正在android中研究nfc,我想知道发现的标签是Mifare Classic还是Mifare Ultralight或任何其他。请告诉我该怎么做?
尝试
String[] techs = tag.getTechList();
for (String t : techs) {
if ("com.android.nfc.tech.MifareClassic".equals(t)) {
... // it's MIFARE Classic
}
else if ("com.android.nfc.tech.MifareUltralight".equals(t)) {
... // it's MIFARE Ultralight
}
}
如果有人仍然想知道,
public synchronized void onTagDiscovered(Tag tag) {
tag.hasTech(8) // Classic
tag.hasTech(9) // Ultralight