Bluetooth communication with Qt 5.2 on Android [closed]

牧云@^-^@ 提交于 2019-12-12 11:32:41

问题


I want to use the Qt framwork to enable my Android devices to communicate over Bluetooth. As of today Qt 5.2 is the newest and from what I understand Bluetooth is not supported yet. On this page:

Qt Bluetooth information

it says that Bluetooth is only supported for Blackberry and Linux (on BlueZ 4.x). I do not know anything about BlueZ, but Android is based on a Linux kernel so is there a possibility that newer versions of Android OS is supported?

I have previously written an app in java that established and sends/receives data over Bluetooth. Is it a good choice using JNI to call the java code? Have anyone done this with Bluetooth?

I assume Bluetooth will be added in an update soon, Qt 5.2.x or 5.3 at latest, but I need a temporary solution.

I am asking here before I decide how to proceed.


回答1:


it says that Bluetooth is only supported for Blackberry and Linux (on BlueZ 4.x). I do not know anything about BlueZ, but Android is based on a Linux kernel so is there a possibility that newer versions of Android OS is supported?

Short answer: No.

Longer elaboration: to see the history behind QtBluetooth, you need to understand that it had been part of Qt Mobility during the Qt 4 lifecycle. It was not an official Qt module, really.

When Nokia turned down the Maemo/MeeGo development, this module became pretty much abandonware. Recently, this module was brought back to life for Qt 5 when the original author from Brisbane joined Digia in Berlin. It has undergone some improvements, but as the documentation writes, Android is not supported at this point.

Also, note that new major features cannot be added to the Qt 5.2 series since only minor bugfix releases will follow without introducing new symbols.

Respectively, your best bet is probably 5.3 for the earliest support date, but do not take it as a guarantee, it will depend a lot on the workload that the people can sacrifice for this module.

Based on the following blog post from KDAB, it seems to be targetted for 5.3. by Bogdan who has been the original author of the Qt Android fork for Qt 4, which has been called Necessitas.

Hope, this clarifies the history, the presence, and the future plans.



来源:https://stackoverflow.com/questions/20753662/bluetooth-communication-with-qt-5-2-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!