使用Qt 5.2在Android蓝牙通信蓝牙、通信、Qt、Android

2023-09-08 08:54:54 作者:我爱陈奕迅!

我想使用Qt的framwork,使我的Andr​​oid设备的蓝牙通信。截至今天的Qt 5.2是最新的,从我的理解,不支持蓝牙呢。本页内容:

Qt的蓝牙信息

它说,蓝牙只支持黑莓和Linux(在4.x版的BlueZ)。我不知道什么的BlueZ,而Android是基于Linux内核所以有一种可能性,即新版本的Andr​​oid操作系统的支持?

我有previously用Java编写的一个应用程序,建立并发送过来的蓝牙/接收数据。它是使用JNI来调用java code一个好的选择吗?有任何人与蓝牙这样做呢?

我认为蓝牙将在更新很快加入,Qt的5.2.x或5.3的最新的,但我需要一个临时的解决方案。

我问这里之前,我决定如何进行。

解决方案   

它说,蓝牙只支持黑莓和Linux(在4.x版的BlueZ)。我不知道什么的BlueZ,而Android是基于Linux内核所以有一种可能性,即新版本的Andr​​oid操作系统的支持?

简短的回答:没有

更长的阐述:看后面QtBluetooth的历史,你要明白,它的Qt的4生命周期中是Qt的流动性的一部分。这是不是一个正式的Qt模块,真的。

在诺基亚推掉的Maemo / MeeGo的开发,该模块成为pretty的很多放弃的。近来,这个模块被带回生活的Qt 5时,从布里斯班原作者加入Digia公司在柏林。它经历了一些改进,但作为文件写道,Android正在不支持这一点。

另外请注意,新的主要功能不能,因为只有轻微的bug修正版本将遵循不引入新的符号加入到了Qt 5.2系列。

分别,你最好的选择可能是5.3最早支持日期,但不要把它作为保证,这将很大程度上取决于工作负载的人可以牺牲此模块。

基于该从KDAB以下博客帖子

,似乎要针对性5.3。由波格丹谁一直是Qt的安卓叉的Qt 4,这被称为Necessitas的原作者。

希望,这阐明了历史,presence,以及未来计划。

android蓝牙通信

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.

解决方案

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.