example of requestSingleUpdates and looper

3,762 views
Skip to first unread message

Di

unread,
Jul 21, 2011, 10:40:40 AM7/21/11
to foursquare API
Hi all,

sorry to bother. i am trying to implement one function like "one hit
to get current location, wait until i get the location, then use this
location to trigger next function", i have couple questions about,
appreciate your help:

1, is requestSingleLocation the best option for this implementation?
2, i dont quiet understand what does "Looper" mean in the method
requestSingleLocation(provider, listener, Looper), could somebody give
me a tutorial or example?

thank you

Max Stoller

unread,
Jul 21, 2011, 10:44:14 AM7/21/11
to foursqu...@googlegroups.com
I'm not sure I understand your question. Can you reply with more background info?

Max




--
@maxstoller / foursquare Platform Intern

Adam Stroud

unread,
Aug 31, 2011, 4:00:34 PM8/31/11
to foursqu...@googlegroups.com
Di:

requestSingleLocation *may* be the right choice, it is had to say definitively without know more about you use case.

From my (limited) experience with requestSingleUpate(), it will only give one location update no matter how many you use with it.  The implications are that you get the first location update that Android has which is often not the most accurate location update.  If the accuracy of this update is good enough for you app, then this might work.

The looper parameter basically controls where the callback will happen from.  For the main thead, just pass null.


Adam
Reply all
Reply to author
Forward
0 new messages