2

I'm working in a project in Android Studio and I need to get my current location .

I searched and I see that there is a way to set location in Extended Controls but I need to get my real position ( I'm trying with Google Map in emulator and it's giving me a location in San José ) is there anyway to get the current location by using an Emulator in android studio ? Thank you in advance !

LouZaa
  • 21
  • 3

1 Answers1

3

If you open the extended controls (3 dots) on your emulator and select the location tab you should be able to change the location to a route (1st picture) or a point (2nd picture) make sure to press "Set Location"

google maps and the emulator controls for gps

single point controls

REInVent
  • 103
  • 7
  • 1
    Thanks for your answer , I did that but I need the real/current location I know it's working when I use a physical device but I need to have my real location in an Emulator – LouZaa Mar 31 '22 at 20:35
  • If it needs to follow a set route my suggestion would be to record a gpx/kml with your physical device and import that to the emulator – REInVent Mar 31 '22 at 20:38
  • https://play.google.com/store/apps/details?id=app.tracklia&gl=US – REInVent Mar 31 '22 at 20:38
  • Thanks you for your help , is there any other possibility to have location without any use a physical device ( I don't have an Android device ) ? – LouZaa Mar 31 '22 at 20:44
  • Have a look at this question and see if you can get any ideas. – REInVent Mar 31 '22 at 20:48
  • https://stackoverflow.com/questions/2279647/how-to-emulate-gps-location-in-the-android-emulator – REInVent Mar 31 '22 at 20:48
  • I saw it before posting my question it doesn't help me a lot , they are setting manually latitude and logitude – LouZaa Mar 31 '22 at 20:52
  • I think the point of the emulator is that every thing is 100% customizable, the best i can suggest is to open google maps in your browser and get your exact location coordinates and paste them into the emulator gps settings – REInVent Mar 31 '22 at 20:59
  • An emulator will never be as good as testing on a physical device – REInVent Mar 31 '22 at 21:00