HTML5可以访问手机上的NFC芯片吗
我对 HTML5 不太熟悉,所以有人知道 HTML5 是否能够访问移动设备内置的 NFC 芯片吗?或者,有人可以建议另一种方法来使用其他方法来做到这一点吗?我的目标是制作一个跨平台 HTML5 Web 应用程序,可以在配备 NFC 的手机上访问 NFC 功能。我研究过像 PhoneGap 这样的移动框架,但尽管他们的路线图上有 NFC,但他们没有提供任何时间表或实施细节。
谢谢。
I'm not too familiar with HTML5 so does anyone know if HTML5 will be able to access NFC chips built into mobile devices? Or, can someone suggest another way to do this using some other method? My goal is to produce a cross platform HTML5 web app that can access NFC functionality on NFC equipped phones. I have looked into mobile frameworks like PhoneGap but although they have NFC on their roadmap, they do not have any timelines nor implementation details to offer.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通过某些专有框架进行 NFC 访问可能是可能的,但我认为它目前尚未内置于HTML 5 规范本身。
PhoneGap 使用 HTML5 作为移动应用程序的主 UI,然后采用您编写的特定代码(我认为是 javascript API),然后将其转换为移植到的每个移动设备的本机代码。因此,您的一个选择是在 HTML5 中构建主 UI,然后在本机应用程序内的 WebView 或等效内容中显示该 UI,然后通过本机应用程序访问 NFC 特定功能,并通过动态 URL(例如 http://mysampleapp.com/NFC/somestringofdatafromthenfcthatiwillparsetouseinmyhtml5app
NFC access via some proprietary framework may be possible, but I don't think it's currently built into the HTML 5 spec itself.
PhoneGap uses HTML5 for the main UI of the mobile application, and then takes specific code that you write (javascript API I think), which is then translated into native code for each of the mobile devices it is ported to. So, one option you have is building your main UI in HTML5, and then displaying that in a WebView or equivalent inside a native application, then accessing NFC specific features via the native application and passing it to your webapp via a dynamic URL like http://mysampleapp.com/NFC/somestringofdatafromthenfcthatiwillparsetouseinmyhtml5app
如果您使用 Phonegap 3.0 和 Cordova CLI,您可以使用 Github 上的 Chariot Solutions Phonegap NFC 插件并按照 Øystein Heimark/Dogu 在参考博客文章中列出的步骤,通过 NFC 轻松集成 RFID 读取功能。
Github:Github 存储库
博客 :
添加Android PHONEGAP 应用程序的 RFID 功能
If you are using Phonegap 3.0 and the Cordova CLI you can easily integrate RFID reading capabilities through NFC by using Chariot Solutions Phonegap NFC plugin from Github and following the steps laid out by Øystein Heimark/Dogu in the referenced blog post.
Github: Github repository
Blog:
ADDING RFID CAPABILITIES TO YOUR ANDROID PHONEGAP APPLICATION