3 Answers, 1 is accepted
0
Hi Brett,
Thank you for contacting us.
I am not sure I understand your question. Could you please elaborate on your requirements and in what kind of application (hybrid, native) you would like to disable the GPS. Please also provide information about which AppBuilder client you are using:
I assume you are looking for this functionality in the Device Simulator and if that is the case I can confirm that we have it logged as a feature request. However, I cannot yet commit to a time frame when it will become available.
Regards,
Ventsislav Georgiev
Telerik
Thank you for contacting us.
I am not sure I understand your question. Could you please elaborate on your requirements and in what kind of application (hybrid, native) you would like to disable the GPS. Please also provide information about which AppBuilder client you are using:
I assume you are looking for this functionality in the Device Simulator and if that is the case I can confirm that we have it logged as a feature request. However, I cannot yet commit to a time frame when it will become available.
Regards,
Ventsislav Georgiev
Telerik
Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.
0
Brett
Top achievements
Rank 1
answered on 18 Jul 2015, 12:41 PM
Hi,
On a physical android device you can disable GPS altogether whereas in the appbuilder simulators (on all platforms) you can only set the location, not disable the functionality.
I would like to simulate switching GPS on and off within the application.
Thanks,
Brett
0
Hello Brett,
I'm afraid we don't have this functionality yet. We have it logged in as a feature request but I cannot commit to a time frame when it will become available. However you should be able to simulate disabling the GPS in the simulator by overriding the behavior of the navigator.geolocation.getCurrentPosition function.
Add this JavaScript code to your application:
This way you could simulate GPS disabling by using the Debug-In-Simulator functionality and changing the flag in the Console pane:
If you need any further assistance don't hesitate to contact us.
Regards,
Ventsislav Georgiev
Telerik
I'm afraid we don't have this functionality yet. We have it logged in as a feature request but I cannot commit to a time frame when it will become available. However you should be able to simulate disabling the GPS in the simulator by overriding the behavior of the navigator.geolocation.getCurrentPosition function.
Add this JavaScript code to your application:
window.disableGPS =
false
;
var
defaultGetCurrentPosition = navigator.geolocation.getCurrentPosition;
navigator.geolocation.getCurrentPosition =
function
() {
if
(window.disableGPS && arguments.length >= 2 &&
typeof
(arguments[1]) ==
'function'
) {
var
positionError =
new
PositionError(PositionError.PERMISSION_DENIED,
"The GPS has been switched off."
);
arguments[1](positionError);
}
else
{
defaultGetCurrentPosition.apply(navigator.geolocation, arguments);
}
};
This way you could simulate GPS disabling by using the Debug-In-Simulator functionality and changing the flag in the Console pane:
window.disableGPS =
true
If you need any further assistance don't hesitate to contact us.
Regards,
Ventsislav Georgiev
Telerik
Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.