6

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.

Mellorine
  • 265
  • 1
  • 5
  • 13
  • Please provide links to the tutorials you tried and tell us where you got stuck in those tutorials. – Aaron Gillion Jan 26 '16 at 01:01
  • At the risk of being self-promoting: http://gabesechansoftware.com/location-tracking/ – Gabe Sechan Jan 26 '16 at 01:06
  • If you want to use LocationManager, use Gabe's GPSTracker. If you want to use FusedLocationProviderApi, take a look here: http://stackoverflow.com/a/30255219/4409409 – Daniel Nugent Jan 26 '16 at 01:10
  • @DanielNugent On my to do list one of these days- write a switcher class that uses Fused if it is installed, and falls back to LocationManager if it doesn't. API is similar enough it ought not be too hard. I just need to find freetime, so probably 2017. – Gabe Sechan Jan 26 '16 at 01:17
  • @GabeSechan That would be awesome! I would definitely use that if you write it! – Daniel Nugent Jan 26 '16 at 01:35
  • @Aaron, i watched several video tutorials in youtube, cant remember the specific link, sorry. – Mellorine Jan 27 '16 at 05:16
  • @Gabe and Daniel, thank you so much, both links show full source code :) it will help a lot in my study – Mellorine Jan 27 '16 at 05:21
  • If you have an answer, please post it as an answer. Thanks. – Android Enthusiast Jan 27 '16 at 17:04

1 Answers1

3

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)

Community
  • 1
  • 1
Mellorine
  • 265
  • 1
  • 5
  • 13