Android - How to get current location (latitude and longitude)?

后端 未结 4 1296
粉色の甜心
粉色の甜心 2020-12-05 05:33

I am using the following code to get the current location namely (latitude and longitude), but I am not getting current location (latitude and longitude).

Anyone kno

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-05 05:59

    In your android manifest did you set the permissions?

    android.permission.ACCESS_FINE_LOCATION
    

    As far as only getting (0,0) co-ords you're probably using the emulator. If you're using eclipse go to the emulator control and at the bottom you can send the fake co-ords to the device

提交回复
热议问题