Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to get the GPS ON/OFF status on the device
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++??
Vincent007 last edited by
Did you try valid property of "PositionSource":http://doc.qt.io/qt-5/qml-qtpositioning-positionsource.html#valid-prop?
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.
In the android device, if the GPS is off but 3G network location is On the valid is true. The accuracy is the obviou
<<<<< Still Looking for a solution BUMP
Are you looking for the PositionSource active property ?
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.
Sorry, that one I don't know how to get.
SherifOmran last edited by
please see the following class
The following enums will show you if there is a gps module or no and if you can access it