Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Get current coordinates in real-time using google map

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.

like image 751
Mellorine Avatar asked Jan 26 '16 00:01

Mellorine


People also ask

How can I get real time location in Android?

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.


1 Answers

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)

like image 172
Mellorine Avatar answered Oct 26 '22 19:10

Mellorine