locationclient.getlastlocation() always returns null on emulator

前端 未结 2 2162
半阙折子戏
半阙折子戏 2021-01-20 04:45

I am new into Android world. I was just referring this tutorial from Google: http://developer.android.com/training/location/retrieve-current.html

Program compiles fi

2条回答
  •  情深已故
    2021-01-20 05:10

    I think the emulator sometimes has its own bugs and issues. maybe that's one of them.

    try the next things:

    • use the latest version of Android for the emulator. also update the ADT & SDK to the latest versions.
    • use alternative emulators
    • use real devices
    • use fake-gps-apps (location mocking) which make the OS think that your device is in some position
    • make sure that in the OS settings, mocking of gps locations is enabled

提交回复
热议问题