更换Android设备上的默认的GPS信号提供者提供者、信号、设备、Android

2023-09-05 00:12:12 作者:泪沾青衫湿

我想用我自己的坐标源替代Android手机默认GPS位置提供。

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

有没有层/ API /库/供应商,让来替换我的信号提供商,而不是内置的GPS硬件,或从外部插件看?它应该允许那些依赖于GPS服务的所有应用程序接收GPS的我的信号来代替。 理想的情况下,更换仍然应该能够访问GPS信号(用于比较/校正或在两个提供商之间切换)。

Is there any layer/API/library/provider that would allow to be replaced with my signal provider instead of the built-in hardware GPS, or read from an external plugin? It should allow all apps that rely on the GPS service to receive my signal instead of GPS. Ideally, the replacement should still be able to access the GPS signal (for comparison/correction or to toggle between the two providers).

我在想例如,实现我自己的LocationManager,并登记到系统中(可选或默认值),如果这是可能的。但在现阶段,我仍然在试图找出什么是可能的和合适的。

I am thinking for example of implementing my own LocationManager, and registering it in the system (as optional or default), if that is possible. But at this stage, I am still trying to find out what is possible and suitable.

感谢您的任何指针。

推荐答案

我是pretty的肯定的精确位置的默认位置提供烘烤成机器人。

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

由于谷歌越来越意识到潜在的误用和滥用系统资源由应用程序,我会说这是一件好事。否则,人们将能够欺骗用户以为他们在其它地方,使用值得信赖的冠冕堂皇的使用GPS卫星的设置。

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.

我可以看到你可以添加一个位置提供的唯一方法是通过[android.location.LocationManager.addTestProvider(......)[1],这需要许可ACCESS_MOCK_LOCATION。现在,这个方法和权限都被记录为进行测试的目的。我无法找到明确指出,任何不被许可的市场发布应用程序的来源,但我强烈怀疑是这种情况。

The only way I can see that you can add a location provider is via [android.location.LocationManager.addTestProvider(......)][1], 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.

[1]:http://developer.android.com/reference/android/location/LocationManager.html#addTestProvider(java.lang.String,布尔,布尔型,布尔型,布尔型,布尔型,布尔型,布尔型,INT,INT)

[1]: http://developer.android.com/reference/android/location/LocationManager.html#addTestProvider(java.lang.String, boolean, boolean, boolean, boolean, boolean, boolean, boolean, int, int)