Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个使用 NFC 标签的应用程序,
有没有办法检测它运行的设备是否有 NFC?如果没有,那么我可以显示替代方法,例如可能手动输入数据,而不是在 NFC 标签上滑动手机?
如果手机具有 nfc 功能,那么我显然会要求他们在当前禁用时将其打开,然后提示他们刷标签。
使用PackageManager:
getPackageManager().hasSystemFeature(PackageManager.FEATURE_NFC)