Emulator's Location simulation not working

后端 未结 13 2016
鱼传尺愫
鱼传尺愫 2020-12-02 19:41

I would like to lower the minimum API level of my application to 4.4(KitKat) from 5.0(Lollipop)

Sadly I couldn\'t get any real devices

相关标签:
13条回答
  • 2020-12-02 20:27

    For me, just opening Goggle maps and skip configuration worked. Started on the default location and then changed to the location that I configured it

    Info:

    Device emulated: Pixel 3A

    Emulator version: 30.0.12-6466327

    Android version: 10.0 (Q) - API 29

    0 讨论(0)
  • 2020-12-02 20:30

    I have also tried to simulate location changing from the Android Device Monitor's "Emulator Control" tab The "Send" button is not clickable at all, the long and lat fields are disabled and I cannot fill anything. The "GPX" and "KML" tabs are also disabled.

    I noticed the same thing, but then I looked in the extended menu on the emulator itself. You can update the location through the emulator menu.

    0 讨论(0)
  • 2020-12-02 20:37

    Last ditch effort: Wipe the emulator data and try again. This is what fixed it for me after Android Studio did an AVD update.

    0 讨论(0)
  • 2020-12-02 20:42

    In my case, the reason was location settings in phone settings set on "Battery saving". Switched it to "High accuracy" and it worked.

    0 讨论(0)
  • 2020-12-02 20:43

    emulator users:

    if you are trying to passing longitude and latitude values from extended controller you have to add this code in your MainActivity.

    String LOCATION_PROVIDER = LocationManager.GPS_PROVIDER;

    in AndroidManifest

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

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

    0 讨论(0)
  • 2020-12-02 20:44

    I had the same problem, but I managed to fix it.

    Run Google Maps and accept confirmations at least once until you see the map. Do not forget to set your location setting to ON/High accuracy, as shown in the screenshot below.

    0 讨论(0)
提交回复
热议问题