Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Problems with QtSensors on Android with Qt 5.3
QtWS25 Last Chance

Problems with QtSensors on Android with Qt 5.3

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 2 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    maxvanceffer
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        maxvanceffer
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

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

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved