android - 如何在不读取 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?
谢谢。
解决方案
充当标签(卡仿真)的手机确实有一个随机 UID(4 字节)。不支持调整特定的 UID。
结果,每次外部字段关闭并再次打开时,手机都会作为不同的 UID。
此致,
推荐阅读
- c++ - 如何删除结构中的类变量?
- c# - 如何使用工作表通过 URL 将图像添加到 Excel 文件
- javascript - 允许重复使用标签的 Javascript 多选库
- mongodb - 客户端的客户端密码验证失败
- c# - 如何以编程方式在 WPF 上的 DataGrid 中简单地添加行?
- javascript - 使用 NgRx 对状态进行分组不起作用
- php - 使用 wsdl 模式验证 soap 输入并显示验证错误
- .htaccess - 为什么 Gzip 压缩 htaccess 不起作用
- r - 在单个闪亮的应用程序中创建多个时间线
- typescript - 如何在 TSConfig 文件中包含我的钩子目录?