Replace default GPS signal provider on Android devices

前端 未结 3 1474
执笔经年
执笔经年 2021-02-03 11:42

I would like to replace the default GPS location provider on android phones with my own coordinate source.

Is there any layer/API/library/provider that would allow to b

3条回答
  •  一整个雨季
    2021-02-03 12:25

    I'm pretty sure the default location providers for fine location are baked into Android.

    Given that Google are becoming more conscious about potential misuse and abuse of system resources by applications, i'd say that's a good thing. Otherwise people would be able to trick the user into thinking they're somewhere else, using the trustworthy sounding 'Use GPS satellites' setting.

    The only way I can see that you can add a location provider is via android.location.LocationManager.addTestProvider(......), which requires the permission ACCESS_MOCK_LOCATION. Now, this method and permission are both documented as being for "testing" purposes. I can't find a source that specifically says that that permission is not granted for market release apps, but I strongly suspect that to be the case.

提交回复
热议问题