简体   繁体   English

适用于Android NDK的NFC API

[英]NFC API for Android NDK

I'm working on a multi-platform project that need support for NFC. 我正在开发一个需要支持NFC的多平台项目。 The project is written in C++ so it would be nice to have access to C++ Android NFC API. 该项目是用C ++编写的,因此可以访问C ++ Android NFC API。

Is there a way to interact with the NFC using the NDK ? 有没有办法使用NDK与NFC进行交互?

I know that from NDK is possible to call SDK Java methods. 我知道从NDK可以调用SDK Java方法。 In this case i could create a Java class to handle the NFC interaction and then call those methods from C++. 在这种情况下,我可以创建一个Java类来处理NFC交互,然后从C ++调用这些方法。

Do you think is possible to develop such mechanism ? 你认为有可能发展这种机制吗?

You need to use JNI to do it. 您需要使用JNI来执行此操作。

Create a Java class that will access Android NFC API and provide you the data in a format that suits your needs. 创建一个Java类,该类将访问Android NFC API并以适合您需要的格式提供数据。 Then access its methods from your C++ code via JNI calls. 然后通过JNI调用从C ++代码访问其方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM