替换 Android 设备上的默认 GPS 信号提供程序 [英] Replace default GPS signal provider on Android devices

查看:32
本文介绍了替换 Android 设备上的默认 GPS 信号提供程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用我自己的坐标源替换 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.

感谢您的任何指点.

推荐答案

我很确定用于精细定位的默认位置提供程序已融入 Android.

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

鉴于 Google 越来越意识到应用程序可能滥用和滥用系统资源,我认为这是一件好事.否则,人们将能够使用听起来可靠的使用 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(......),需要ACCESS_MOCK_LOCATION权限.现在,此方法和权限都被记录为用于测试"目的.我找不到明确说明未授予市场发布应用许可的消息来源,但我强烈怀疑情况确实如此.

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.

这篇关于替换 Android 设备上的默认 GPS 信号提供程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆