html5 调用 nfc,Can HTML5 access NFC chips on mobile phones

问题

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.

回答1:

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

回答2:

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

来源:https://stackoverflow.com/questions/5668647/can-html5-access-nfc-chips-on-mobile-phones

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值