NFC 与 JavaScript
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9729743/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
NFC with JavaScript
提问by Dinkheller
is there any JavaScript NFC API? I would like to read tags from a WebApplication (without PhoneGap). Or is there any way to use the NFC from JavaScript through JAVA?
有没有 JavaScript NFC API?我想从 WebApplication(没有 PhoneGap)读取标签。或者有什么方法可以通过 JAVA 从 JavaScript 使用 NFC?
Best
最好的事物
采纳答案by gVibrac
You can't read tags from webApplication. Browsers does not communicate with NFC resources (it bored me too!!) The unique way to implementing NFC features with Javascript through Android Browser is using a WebView or framework like phoneGap in a native app.
您无法从 webApplication 读取标签。浏览器不与 NFC 资源通信(这也让我感到厌烦!!)通过 Android 浏览器使用 Javascript 实现 NFC 功能的独特方法是在本机应用程序中使用 WebView 或像 phoneGap 这样的框架。
回答by lexicore
回答by facundofarias
In the near future it could be possible to use NFC directly from the browser, check this out
在不久的将来,可以直接从浏览器使用 NFC,请查看
Or, if you want more info about then you can check the Mozilla MDN Docabout this! Sounds interesting indeed
或者,如果您想了解更多信息,您可以查看Mozilla MDN 文档!听起来确实很有趣
Based on this link, you can also check if you browser has support for NFC.
基于此链接,您还可以检查您的浏览器是否支持 NFC。
Interesting link about it: Web NFC Community Group report
回答by djolemag
They have proprietary API that support JavaScript
or Java
applets connection to their NFC
reader. API is free of charge and seems as very good alternative.
他们有专有的 API 支持JavaScript
或Java
小程序连接到他们的NFC
阅读器。API 是免费的,似乎是一个很好的选择。
Read more at http://www.d-logic.net/nfc-rfid-reader-sdk/