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 (https://seap.samsung.com/api-references/android/reference/com/samsung/android/knox/location/LocationPolicy.html) 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 (https://seap.samsung.com/api-references/android/reference/com/samsung/android/knox/location/LocationPolicy.html#setGPSStateChangeAllowed(boolean)will not allow the user to change this if set to false.

I've noticed that I could use some combination of setLocationProviderState (https://seap.samsung.com/api-references/android/reference/com/samsung/android/knox/location/LocationPolicy.html#setLocationProviderState(java.lang.String,%20boolean)) and startGps (https://seap.samsung.com/api-references/android/reference/com/samsung/android/knox/location/LocationPolicy.html#startGPS(boolean)) 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.

GIOVANNI ROBERTO ... BONI MACHADO
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:

https://seap.samsung.com/forum-topic/gps-stops-working-when-phone-locked...

10x a lot for any help.

Giovanni

Brasilia/DF

 

 

Updated: Aug 22, 2019 at 7:01 pm