Eduardo Klein
Aug 01, 2019
2:33 pm

Alternatives to keep GPS always on

Hello there,

We are going to use the LocationPolicy from Knox SDK ( to block user from turning the GPS off. We have specific demand that user must be on High Accuracy location mode.

I've searched here for some insights on how to accomplish this request, but got somehow confused with the deprecation of some methods in the Knox SDK. We have "on field" use cases where the High Accuracy is already off on the device. As you noticed in Android 9, there is no such a thing as "Location Mode" anymore, is just, use or not the GPS, and Google (hopefully) will do the best to give you the best location precision. I understood that the method setGPSStateChangeAllowed ( not allow the user to change this if set to false.

I've noticed that I could use some combination of setLocationProviderState (,%20boolean)) and startGps ( to accomplish this task, but I've also noticed that both this method was deprecated in API level 27.

So, since that methods were deprecated, how can we, using the Knox SDK, force the user to keep it on always?

Best regards.

Aug 22, 2019
7:01 pm

Hello, Eduardo!

Have you find a solution?

I think I have a similar issue and perhaps your solution could help me.

Take a look, at this, please:

10x a lot for any help.





Updated: Aug 22, 2019 at 7:01 pm