Sorry, I guess I'm being dim. Should I add some code inside the
onLocationChanged method itself to check the accuracy? And then just
check this number when the user clicks on the button?

public void onLocationChanged(Location location) {
   accuracy = location.getAccuracy();
                        }

On Jul 16, 10:27 pm, Anna PS <[email protected]> wrote:
> Thanks Mark. When you say "using the LocationListener", what exactly
> do you mean?
>
> Is there a way that I can poll the listener directly - I know that
> there is an onLocationChanged event, but does that help me?
>
> Basically what I want is something that, when the user clicks the
> report button, (i) gets the location, (ii) checks that the accuracy is
> okay, and (iii) if it isn't okay, shows the user a progress dialog
> until the accuracy improves enough to be acceptable.
>
> best wishes,
> Anna
>
> On Jul 16, 10:17 pm, Mark Murphy <[email protected]> wrote:
>
>
>
> > Anna PS wrote:
> > > Basically my question is this - does the fact that I'm running a
> > > background thread somehow make the accuracy worse? Or is the problem
> > > in my code, something to do with the way that I'm polling the GPS
> > > data?
>
> > I cannot say for certain whether your background thread is causing your
> > GPS accuracy issues.
>
> > However, I don't think you need that background thread. Have you tried
> > just using your (presently no-op) LocationListener?
>
> > Your choice of 0,0 for distance and duration on requestLocationUpdates()
> > means, AFAIK, that your LocationListener will get fixes as soon as they
> > are available via onLocationChanged() (docs: "To obtain notifications as
> > frequently as possible, set both parameters to 0."). Try using the
> > listener instead of the background thread/getLastKnownLocation() and see
> > what the results are.
>
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> > _Android Programming Tutorials_ Version 1.0 Available!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to