I tried several tutorials but no luck getting current coordinates, maybe i cant follow or really dont know how to set up one.
Sorry for being newbie. I just want to create an app that will get current location thru gps, whether location is change or not. I can manage to get the last known location but cannot implement to get real-time coordinates. It will be much appreciated to have a whole source that will show the solution. I get easily lost in part by part code.
Thank you in advance.
There are two ways to get the current location of any Android device: Android's Location Manager API. Fused Location Provider: Google Play Services Location APIs.
Both links provide useful code
For LocationManager, visit this link: http://gabesechansoftware.com/location-tracking/ (Gabe Sechan)
For FusedLocationProviderApi, visit this link: https://stackoverflow.com/a/30255219/4409409 ( Daniel Nugent)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With