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. Qt simulates accelerometer, how to detect simulated QAccelerometer?
Forum Updated to NodeBB v4.3 + New Features

Qt simulates accelerometer, how to detect simulated QAccelerometer?

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 3 Posters 1.1k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    AndreasBuhr
    wrote on 5 Apr 2014, 10:36 last edited by
    #1

    Hi there,

    I developed a little app for Android and PC using Qt 5.2.1. It works nice. There are two ways of interacting with the app: The first way is using the Accelerometer, the second way is using the mouse. The app can switch between these modes. I'd like to use the Accelerometer by default and, if it is not available, use the mouse mode.

    When I start my app on the PC, I can use the accelerometer, and it tells me that my device is upright and gravity is 9.8 m/s^2. Since my PC does not have an accelerometer, it seems that an accelerometer is simulated.

    How can I distinguish between a real accelerometer and a simulated one?

    cheers,
    Andreas

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 5 Apr 2014, 20:56 last edited by
      #2

      Hi,

      Just an idea, but you could use the sensor description for that.

      Hope it helps

      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
      • C Offline
        C Offline
        cezmen
        wrote on 6 Apr 2014, 02:43 last edited by
        #3

        I believe (iOS or Android) simulators or emulators do not simulate or emulate Qt Sensors completely. Although you may detect them, their implemented backends cannot produce real data. For example, on iOS simulator, Accelerometer sensor is detected and can be started by code, but produces no data. For testing Qt Sensors, one must do it in real devices.

        1 Reply Last reply
        0

        1/3

        5 Apr 2014, 10:36

        • Login

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