在android上运行qml蓝牙扫描程序时找不到蓝牙模块

时间:2013-12-25 11:43:11

标签: android qt bluetooth qml

我安装了qt5.2 for android我正在尝试在我的Android设备上运行一个代码为

的应用程序
import QtQuick 2.1
import QtQuick.Controls 1.0
import QtBluetooth 5.0

ApplicationWindow {
    title: qsTr("Hello World")
    width: 640
    height: 480

    menuBar: MenuBar {
        Menu {
            title: qsTr("File")
            MenuItem {
                text: qsTr("Exit")
                onTriggered: Qt.quit();
            }
        }
    }

    Button {
        text: qsTr("Hello World")
        anchors.centerIn: parent
    }
}

应用程序无法运行,我得到此应用程序输出

Starting remote process.D/dalvikvm(31265): Late-enabling CheckJNI
D/dalvikvm(31265): GC_CONCURRENT freed 245K, 11% free 7211K/8071K, paused 12ms+2ms,   total 27ms
D/dalvikvm(31265): GC_CONCURRENT freed 455K, 14% free 7231K/8327K, paused 1ms+1ms, total 15ms
D/dalvikvm(31265): Trying to load lib    /data/data/org.qtproject.example.app1/lib/libgnustl_shared.so 0x417ddb68
D/dalvikvm(31265): Added shared lib /data/data/org.qtproject.example.app1/lib/libgnustl_shared.so 0x417ddb68
D/dalvikvm(31265): No JNI_OnLoad found in /data/data/org.qtproject.example.app1/lib/libgnustl_shared.so 0x417ddb68, skipping init
D/dalvikvm(31265): Trying to load lib /data/data/org.qtproject.example.app1/lib/libQt5Core.so 0x417ddb68
D/dalvikvm(31265): Added shared lib /data/data/org.qtproject.example.app1/lib/libQt5Core.so 0x417ddb68
D/dalvikvm(31265): Trying to load lib /data/data/org.qtproject.example.app1/lib/libQt5Network.so 0x417ddb68
D/dalvikvm(31265): Added shared lib  /data/data/org.qtproject.example.app1/lib/libQt5Network.so 0x417ddb68
I/Qt      (31265): Network start
D/dalvikvm(31265): Trying to load lib /data/data/org.qtproject.example.app1/lib/libQt5Qml.so 0x417ddb68
D/dalvikvm(31265): Added shared lib /data/data/org.qtproject.example.app1/lib/libQt5Qml.so 0x417ddb68
D/dalvikvm(31265): No JNI_OnLoad found in /data/data/org.qtproject.example.app1/lib/libQt5Qml.so 0x417ddb68, skipping init
D/dalvikvm(31265): Trying to load lib /data/data/org.qtproject.example.app1/lib/libQt5Gui.so 0x417ddb68
D/dalvikvm(31265): Added shared lib /data/data/org.qtproject.example.app1/lib/libQt5Gui.so 0x417ddb68
D/dalvikvm(31265): No JNI_OnLoad found in /data/data/org.qtproject.example.app1/lib/libQt5Gui.so 0x417ddb68, skipping init
D/dalvikvm(31265): Trying to load lib /data/data/org.qtproject.example.app1/lib/libQt5Quick.so 0x417ddb68
D/dalvikvm(31265): Added shared lib /data/data/org.qtproject.example.app1/lib/libQt5Quick.so 0x417ddb68
D/dalvikvm(31265): No JNI_OnLoad found in /data/data/org.qtproject.example.app1/lib/libQt5Quick.so 0x417ddb68, skipping init
D/dalvikvm(31265): Trying to load lib /data/data/org.qtproject.example.app1/lib/libQt5QuickParticles.so 0x417ddb68
D/dalvikvm(31265): Added shared lib /data/data/org.qtproject.example.app1/lib/libQt5QuickParticles.so 0x417ddb68
D/dalvikvm(31265): No JNI_OnLoad found in /data/data/org.qtproject.example.app1/lib/libQt5QuickParticles.so 0x417ddb68, skipping init
D/dalvikvm(31265): Trying to load lib /data/data/org.qtproject.example.app1/lib/libQt5Widgets.so 0x417ddb68
D/dalvikvm(31265): Added shared lib /data/data/org.qtproject.example.app1/lib/libQt5Widgets.so 0x417ddb68
D/dalvikvm(31265): No JNI_OnLoad found in /data/data/org.qtproject.example.app1/lib/libQt5Widgets.so 0x417ddb68, skipping init
D/dalvikvm(31265): Trying to load lib /data/data/org.qtproject.example.app1/plugins/platforms/android/libqtforandroidGL.so  0x417ddb68
D/dalvikvm(31265): Added shared lib /data/data/org.qtproject.example.app1/plugins/platforms/android/libqtforandroidGL.so 0x417ddb68
I/Qt      (31265): qt start
W/dalvikvm(31265): dvmFindClassByName rejecting 'org/qtproject/qt5/android/QtMessageDialogHelper' 

D/dalvikvm(31265): Trying to load lib /data/data/org.qtproject.example.app1/lib/libQt5QuickParticles.so 0x417ddb68
D/dalvikvm(31265): Shared lib  '/data/data/org.qtproject.example.app1/lib/libQt5QuickParticles.so' already loaded in same   CL 0x417ddb68
D/dalvikvm(31265): Trying to load lib /data/data/org.qtproject.example.app1/lib/libapp1.so 0x417ddb68
D/Qt      (31265): qml/qqmlengine.cpp:1451 (QQmlDebuggingEnabler::QQmlDebuggingEnabler(bool)): QML debugging is enabled. Only use this in a safe environment.
D/dalvikvm(31265): Added shared lib /data/data/org.qtproject.example.app1/lib/libapp1.so 0x417ddb68
D/dalvikvm(31265): No JNI_OnLoad found in /data/data/org.qtproject.example.app1/lib/libapp1.so 0x417ddb68, skipping init
W/Qt      (31265): kernel/qcoreapplication.cpp:416  (QCoreApplicationPrivate::QCoreApplicationPrivate(int&, char**, uint)): WARNING:  QApplication was not created in the main() thread.
W/dalvikvm(31265): dvmFindClassByName rejecting 'org/qtproject/qt5/android/QtNativeInputConnection'
W/dalvikvm(31265): dvmFindClassByName rejecting 'org/qtproject/qt5/android/QtExtractedText'
D/libEGL  (31265): loaded /system/lib/egl/libEGL_mali.so
D/libEGL  (31265): loaded /system/lib/egl/libGLESv1_CM_mali.so
D/libEGL  (31265): loaded /system/lib/egl/libGLESv2_mali.so
D/        (31265): Device driver API match
D/        (31265): Device driver API version: 10
D/        (31265): User space API version: 10 
D/        (31265): mali: REVISION=Linux-r2p4-02rel0 BUILD_DATE=Tue Oct 16 15:37:13 KST  2012 
D/AbsListView(31265): Get MotionRecognitionManager
D/dalvikvm(31265): GC_CONCURRENT freed 439K, 13% free 7263K/8327K, paused 2ms+12ms, total 35ms
W/InputEventReceiver(31265): Attempted to finish an input event but the input event  receiver has already been disposed.
D/AbsListView(31265): Get MotionRecognitionManager
W/libEGL  (31265): eglTerminate() called w/ 1 objects remaining
W/SurfaceView(31265): CHECK surface infomation creating=false formatChanged=false  sizeChanged=false visible=false visibleChanged=true surfaceChanged=true  realSizeChanged=false redrawNeeded=false left=false top=false
I/AndroidRuntime(31265): VM exiting with result code 0, cleanup skipped.

但它编译并运行为桌面应用程序,没有错误

更新:如果我发表评论import QtBluetooth 5.0,它会在我的设备上运行,但我正在尝试制作应用以使用我设备的蓝牙,所以我需要它

1 个答案:

答案 0 :(得分:1)

目前QtBluetooth不支持Android,所以这是预期的。

有关详细信息,请参阅documentation

  

新的Qt蓝牙模块允许您检索有关本地蓝牙设备的信息,扫描和检索有关范围内设备的信息,将文件推送到设备并使用RFCOMM连接到它们。 Qt蓝牙模块目前仅支持Linux(在BlueZ 4.x上)和BlackBerry。

有关更多详细信息,请参阅今天的my other answer以获取更多详细信息。

希望这有帮助。