Problems with QtSensors on Android with Qt 5.3



  • Hi, to all. I have a problem with QAndroidPlatformIntegrationPlugin and AndroidSensorPlugin under Android. And i wonder if it problem in my code or this is a bug of Qt.

    System: Ubuntu 14.04
    Compiler: gcc 4.8
    JAVA: java-6-openjdk-i386
    Android sdk: adt-bundle-linux-x86-20130911
    Android ndk: android-ndk-r9

    Problem:
    When i run my application in emulator i see such rows in console

    W/Qt ( 852): gestures/qsensorgesturemanagerprivate.cpp:102 (void QSensorGestureManagerPrivate::initPlugin(QObject*)): Could not load QAndroidPlatformIntegrationPlugin(0x2a130798)
    W/Qt ( 852): gestures/qsensorgesturemanagerprivate.cpp:102 (void QSensorGestureManagerPrivate::initPlugin(QObject*)): Could not load AndroidSensorPlugin(0x2a38af38)

    Code:

    @import QtQuick 2.2
    import QtSensors 5.3 as Sensors

    ApplicationWindow {
    Sensors.SensorGesture {
    id: sensorGesture
    enabled: true
    gestures : ["QtSensors.shake"]
    onDetected:{
    sourceText.clearText()
    translatedText.clearText()
    }

        Component.onCompleted: { errorDialog.text = sensorGesture.availableGestures.join(",") }
    }
    
    Component.onCompleted: {
        var types = Sensors.QmlSensors.sensorTypes();
        console.log(types.join(", "));
    }
    

    }@

    But output for Sensors.QmlSensors.sensorTypes(); gives this ouput

    QMagnetometer, QTiltSensor, QProximitySensor, QAccelerometer, QAmbientLightSensor, QOrientationSensor, QAmbientTemperatureSensor

    And QtSensors.shake is not working. Tried on my Android device.

    Please, if somebody knows something about this, give me advice. If need some more code, or some more debug output, ask and i will add it.

    Thanks.


  • Lifetime Qt Champion

    Hi,

    Just a wild guess but are you sure the sensors plugin are deployed with your application ?



  • Hmm, strange thing but on real device it worked. After several clean rebuilds. But on emulator it doesn't.


  • Lifetime Qt Champion

    I haven't checked but does the emulator offer sensors input ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.