首页 > 解决方案 > 如何在不读取 android 上的 nfc 的情况下获取手机的唯一 nfc id?

问题描述

我知道如何获取 Nfc 唯一 ID,当 NFC 阅读器时,

private Tag tag;

//Read success.
protected void onNewIntent(Intent intent) {
   super.onNewIntent(intent);

   tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);

   byte[] id = tag.getId();

}

但我想即使我不读取 NFC 卡。

如何在不读取 android 上的 nfc 的情况下获取 NFC id?

谢谢。

标签: androidnfc

解决方案


充当标签(卡仿真)的手机确实有一个随机 UID(4 字节)。不支持调整特定的 UID。

结果,每次外部字段关闭并再次打开时,手机都会作为不同的 UID。

此致,


推荐阅读