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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-16 06:49:48  来源:igfitidea点击:

NFC with JavaScript

javajavascriptapiweb-applicationsnfc

提问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

I haven't tried actually tried it myself, but there is a a number of NFC plugins 1,2,3for PhoneGap. This should allow you to use NFC in your HTML applications. See also:

我自己还没有尝试过,但有很多 NFC 插件123用于PhoneGap。这应该允许您在 HTML 应用程序中使用 NFC。也可以看看:

回答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

有趣的链接:Web NFC Community Group report

回答by djolemag

They have proprietary API that support JavaScriptor Javaapplets connection to their NFCreader. API is free of charge and seems as very good alternative.

他们有专有的 API 支持JavaScriptJava小程序连接到他们的NFC阅读器。API 是免费的,似乎是一个很好的选择。

Read more at http://www.d-logic.net/nfc-rfid-reader-sdk/

http://www.d-logic.net/nfc-rfid-reader-sdk/阅读更多信息