How to get the GPS ON/OFF status on the device
-
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
-
Did you try valid property of "PositionSource":http://doc.qt.io/qt-5/qml-qtpositioning-positionsource.html#valid-prop?
-
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.
-
@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!!!!
-
<<<<< Still Looking for a solution BUMP
-
Hi,
Are you looking for the PositionSource active property ?
-
Sorry, that one I don't know how to get.
-
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