1

I am developing an app which takes users current location and make changes in the coordinates. I am simply trying to fake users current location but i don't know how should i change coordinates. can i simply just add some value to the latitude and longitude like this:

newlongitude=currentlongitude+0.01000;
Eugen Hotaj
  • 383
  • 2
  • 10
Abhishek
  • 95
  • 1
  • 8
  • You might want to take a look at the android docs https://developer.android.com/guide/topics/location/strategies.html. – Eugen Hotaj Aug 17 '16 at 20:52
  • I know how to use location manger and all that. I am just trying to take users current location and move user location little bit every time when user clicks button . But i don't know what will be the exact coordinates. so if i just add some value to the current location like this: newlongitude=currentlongitude+0.01000; so is it a right way for changing coordinates? – Abhishek Aug 18 '16 at 20:48

1 Answers1

2

You can only emulate a new location. Basically you have to pass the values of the new location to Location instance and set Manager Location with Location instance.

I think this can help you:

Access Mock Location

Use Mock Location in App

Community
  • 1
  • 1
Martin Sch
  • 64
  • 2