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. How to get the GPS ON/OFF status on the device

How to get the GPS ON/OFF status on the device

Scheduled Pinned Locked Moved Mobile and Embedded
9 Posts 4 Posters 3.7k 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
    MathArtist
    wrote on 6 Jan 2015, 21:33 last edited by
    #1

    Hello Everybody.

    I'm looking for a way to determine if the gps feature is ON o Off in the android device settings from QML.

    PositionSource::supportedPositioningMethods just tell if the GPS is suported.
    But don't tell if GPS is set on/off in the device.

    I'm guessing now, if accuracy value is very big, I Show a message "Please Turn GPS ON" but i can't tell if it is off or just bad signal.

    Can it be know from pure QML?
    if not, what is the simplest way to do it in C++??

    Best Regards

    1 Reply Last reply
    0
    • V Offline
      V Offline
      Vincent007
      wrote on 7 Jan 2015, 12:47 last edited by
      #2

      Did you try valid property of "PositionSource":http://doc.qt.io/qt-5/qml-qtpositioning-positionsource.html#valid-prop?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MathArtist
        wrote on 7 Jan 2015, 13:07 last edited by
        #3

        Hi Vincent007,
        Yes I use the valid property in my App,
        In the android device, if the GPS is off but 3G network location is On the valid is true. The accuracy is the obvious difference.

        Must be some other property, but Didn't find it yet.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MathArtist
          wrote on 28 Jun 2015, 18:45 last edited by
          #4

          @MathArtist said:

          In the android device, if the GPS is off but 3G network location is On the valid is true. The accuracy is the obviou

          BUMP!!!!

          1 Reply Last reply
          0
          • M Offline
            M Offline
            MathArtist
            wrote on 22 Nov 2015, 07:56 last edited by
            #5

            <<<<< Still Looking for a solution BUMP

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 22 Nov 2015, 22:06 last edited by
              #6

              Hi,

              Are you looking for the PositionSource active property ?

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

              M 1 Reply Last reply 22 Nov 2015, 22:43
              0
              • S SGaist
                22 Nov 2015, 22:06

                Hi,

                Are you looking for the PositionSource active property ?

                M Offline
                M Offline
                MathArtist
                wrote on 22 Nov 2015, 22:43 last edited by
                #7

                @SGaist Hi.
                I want to know if the coordinates are from actual GPS or form 3G source.
                in both cases teh positionSource aactive property is true but I need to be sure if it is the actual gps or network location data.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 23 Nov 2015, 21:33 last edited by
                  #8

                  Sorry, that one I don't know how to get.

                  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
                  • S Offline
                    S Offline
                    SherifOmran
                    wrote on 28 Oct 2019, 22:38 last edited by
                    #9

                    please see the following class

                    https://doc.qt.io/qt-5/qgeopositioninfosource.html

                    The following enums will show you if there is a gps module or no and if you can access it

                    QGeoPositionInfoSource::AccessError
                    QGeoPositionInfoSource::NoPositioningMethods
                    
                    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