Android mock location on device?


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.

3/27/2010 11:23:25 PM

Accepted Answer

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" /> 

to your manifest.

Now you can go in your code and create your own mock location provider and set the location of this provider.

4/20/2012 2:55:22 PM

If you use this phone only in development lab, there is a chance you can solder away GPS chip and feed serial port directly with NMEA sequences from other device.

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow