在Android的设备模拟位置? [英] Android mock location on device?
本文介绍了在Android的设备模拟位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何物理设备(的Nexus One)在嘲笑我的位置?我知道你可以在模拟器控制面板模拟器做到这一点,但是这并没有对物理设备的正常工作。
How can I mock my location on a physical device (Nexus One)? I know you can do this with the emulator in the Emulator Control panel, but this doesn't work for a physical device.
推荐答案
这似乎做的唯一方法是使用一个模拟的位置提供。
It seems the only way to do is to use a mock location provider.
您必须启用在开发板上模拟地点的设置并添加
You have to enable mock locations in the development panel in your settings and add
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
你的清单。
现在你可以在你的code和创建自己的模拟位置信息提供者,并将此提供者的位置。
Now you can go in your code and create your own mock location provider and set the location of this provider.
这篇关于在Android的设备模拟位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文