I'm trying to build an app using the GoogleMaps API and the user's location (once-off) and trying to find out how best to approach this but it seems like the approach the Stack Overflow answers take is very different to the approach the Android Developer site takes.
Basically the SO answers suggest subscribing to service that gives you location updates which you handle in a callback, whether you want the location once (like me) or actually plan to use the updated positions. (Post 1, Post 2, both highly up-voted)
However the Android dev site says you should connect a LocationClient and then just call getLastLocation()
as you need it, which removes a bunch of the switching between sync and async coding elements.
So, I'm still confused as to what the "best-practice" way of doing this is and to why the Android dev site doesn't agree with the high-scoring answers here.