Spoof or fake location on Android phone

I am trying to get this to work for several days without success. Basically, I am writing a small test application so that the phone reports it as another place using addTestProvider and setTestProviderLocation, etc. In principle, it looks normal and seems to report a change in its location, however Google Maps, etc., It looks like it is still requesting a real GPS provider. Anyone have any ideas how to get around this?

This is not an application that will actually be used for anything, just to satisfy my curiosity and gain understanding.

Thanks in advance.

+6
android location spoofing
source share
1 answer

First, you must allow your application to use Mock locations by adding the following to the xml manifest:

<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/> 

On your phone, make sure that the "Mock Locations" function is enabled by selecting the "Allow Layout" option in the Settings -> Applications -> Development menu.

And then use the location provider to give fake locations (for example, by reading data from the / db file).

Alternatively, you can use telnet on your phone and make fun of the location (again you need the resolution and layout of the locations included on your phone):

 $ telnet localhost 5554 Android Console: type 'help' for a list of commands OK geo fix -82.411629 28.054553 OK 
+5
source share

All Articles