How do I get the current GPS location programmatically in Android?

前端 未结 22 2653
梦谈多话
梦谈多话 2020-11-21 04:42

I need to get my current location using GPS programmatically. How can i achieve it?

22条回答
  •  遇见更好的自我
    2020-11-21 04:53

    I have published a small library that can make it easy to get location data in Android, it even takes care of Android M runtime permissions.

    You might check it out here: https://github.com/julioromano/RxLocation and use it or its source code as examples for your implementation.

提交回复
热议问题