Hi all I'd like to figure out the best way to get a recent location fix, with the minimum disruption to the user flow.
Here's what I would like the user to see in my app: 1. [After e.g. taking a photo, and with no delay] Click a button saying 'Upload your file' 2. [With no delay] See a notification saying 'Your file is being uploaded'. In the background, we wait for an up-to-date location fix, then send the file and location info to the remote site. Meanwhile the user can go away and read email or whatever 3. [After upload] See a notification saying 'Your file has been uploaded'. The above, for the user, is convenient and seamless - they don't even know that we have to wait to get a location fix, it looks as though the only think happening is the upload. How can I engineer this in terms of intents? Here's what I think would most closely approximate the above: 1. Normal intent, show a button, handle the onClick event to start an IntentService 2. From the IntentService (1) show a notification saying 'Your file is being uploaded' (2) get a location listener, keep checking LastKnownLocation for age/accuracy (3) once it's acceptable, start the upload. Meanwhile, the user can do whatever they want 3. From the IntentService, when we get a 200 response from the server, show a notification that 'Your file has been uploaded', But - is it possible to get a location fix from within an IntentService? If not, then what is the best way to get a fix, wait for the right accuracy, then start an upload - without the user having to hang around keeping the application open? This must be a common problem, so it would be good to get a clear answer. many thanks Anna -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe, reply using "remove me" as the subject.

