对于communicaion通过蓝牙Android的有原生API?如果是的话我在哪里可以找到文件建立? [英] Are there native APIs for communicaion over Bluetooth in Android?if so where do i find the documentaion?

查看:251
本文介绍了对于communicaion通过蓝牙Android的有原生API?如果是的话我在哪里可以找到文件建立?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的Andr​​oid和蓝牙,对不起任何愚蠢的问题。

I am new to android and Bluetooth, sorry for any stupid questions

我有一个C ++库,这有助于建立到在LAN和串行端口的POS终端的通信,现在我想这个库只有通过蓝牙媒体的Andr​​oid手机上运行,​​

I have a C++ library which helps in establishing communication to a POS terminal over LAN and serial port, now i want this library to work on android phone only over Bluetooth medium,

如果有对Android的蓝牙通信原生API,我可以端口这个C ++库到Android和写入将通过JNI使用这个库的Java应用程序

If there are native APIs for Bluetooth communication in android, I can port this c++ library to android and write a java application which will use this library through JNI

是否有Android的蓝牙原生API,如果是这样我在哪里可以找到文档?

Are there native APIs for Bluetooth in android , if so where do i find the documentation ?

先谢谢了。

推荐答案

我刚才看了这个一般性问题(Java的主场迎战一对Android原生的蓝牙),最终得出的结论是本机API没有提供任何额外的相对功能Java API的 - 所以没有优势我去原生支持蓝牙

I looked at this general issue (java vs. native Bluetooth on Android) a while ago and eventually concluded that the native API did not provide any extra functionality relative to the Java API - so there was no advantage for me in going native for Bluetooth.

和Java蓝牙API,这是有据可查的,其实是相当有限的相比,你可能期望从未来如桌面Linux,Mac或Windows操作系统。您是从HCI英里远。问题的关键是,你可能会发现你的库所需的API的不可用在Android上(除非它需要更多一点,然后RFCOMM套接字)。

And the Java Bluetooth API, which is well documented, is actually quite limited compared to what you might expect coming from e.g. desktop Linux, Mac, or Windows. You are miles away from the HCI. The point being, that you may well find that the API's required by your library are not available on Android (unless it requires little more then RFCOMM sockets).

如果Android的蓝牙API的做满足你的库的要求,那么,你可以从本地code访问它们,所以你能端口库。

If the Android Bluetooth API's do meet the requirements of your library, then yes, you can access them from native code so you could port your library.

告诫:当我看着这个我看到​​了开发者,我们强烈建议从本地了,所以我没有做在Android上的任何本地和我只反映我读

Caveat: when I looked at this I saw that devs are strongly advised away from native, so I have not done any native on Android and am only reflecting what I read.

这篇关于对于communicaion通过蓝牙Android的有原生API?如果是的话我在哪里可以找到文件建立?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆