Re: [android-developers] Re: GPS accuracy reliability

2010-07-15 Thread Jonas Petersson

Hi jgostylo,

On 07/15/2010 07:01 AM, jgostylo wrote:

All of this and people have only sort of answered my question.  I
understand that the answer may just be I don't really know what it
would do and I understand that really isn't an answer people post on
the forum because it does not fill the information gap.  The accuracy
is a function of the number of satellites in view and other stuff.  I
get that.  But the question remains the same.  When it tells me my
location is hundreds of miles from where I actually am, will the call
to getAccuracy return hundreds of thousands of meters?


I don't know if what I've noted is of any help at all, but here we go 
anyway:


It is easy to get confused when mixing network(coarse) and gps(fine) 
providers if you just listen to both. For network I've seen it be 
radically off many times (presumably the operator has messed up IDs and 
positions), but at least it is usually quick to report SOMETHING. When 
it comes to gps I would say that the the blue circle shown on Google Map 
quite often would have to be twice as big for the first few samples 
(with pretty bad accuracy) to show the truth, but when it comes down to 
two digit meters it usually is quite good for me - even when I'm indoors 
(reasonably low buildings). Compared to the iPhone3GS that my colleagues 
use, it is significantly better actually. This might just be luck with 
my particular devices, though. So basically, to be on the safe side, I'd 
say double the number of meters you get from accuracy.


The other thing that you will need to consider is to have a best 
before timestamp on all positions. In some cases I've had a pretty good 
position from the GPS for a long time when for some reason it drops the 
signal and you need to go back to network until it comes back. If you 
are moving fast (say sitting on a train with iffy net coverage too) this 
can get pretty strange results if you trust your old data for too long. 
(Your currentLocationAccuracy variable may be trying to address this?)


Obviously, debugging this is hard and potentially expensive (even 
dangerous if you drive yourself!).


Disclaimer: I don't claim to be an expert on this, this above is just 
based on my own observations.


/ Jonas

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: GPS accuracy reliability

2010-07-14 Thread jgostylo
drpickett:
When I say I demand a certain accuracy from the GPS what I mean is
that when it reports a location I call getAccuracy and if it is not
good enough I throw away the result.  Maybe I should just be more
lenient on the accuracy from a network location.

All of this and people have only sort of answered my question.  I
understand that the answer may just be I don't really know what it
would do and I understand that really isn't an answer people post on
the forum because it does not fill the information gap.  The accuracy
is a function of the number of satellites in view and other stuff.  I
get that.  But the question remains the same.  When it tells me my
location is hundreds of miles from where I actually am, will the call
to getAccuracy return hundreds of thousands of meters?


PsuedoCode for the previous request (may be missing and spotty but you
get the gist):

public class ContainerClass extends Activity

  onCreate(Bundle savedInstanceState)
  {
...
lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
Criteria myCriteria = new Criteria();
myCriteria.setAccuracy(Criteria.ACCURACY_FINE);

providerList = lm.getProviders(true);

for (String provider : providerList)
{
  if (provider.equals(LocationManager.GPS_PROVIDER))
  {
lm.requestLocationUpdates(provider, 7000, 20, gpsLocationListener);
  }
  else if (provider.equals(LocationManager.NETWORK_PROVIDER))
  {
lm.requestLocationUpdates(provider, 7000, 20,
networkLocationListener);
  }
}
  }

// Wireless location listener
private final LocationListener networkLocationListener = new
LocationListener() {
  public void onLocationChanged(Location location) {

ContainerClass.this.gpsLocationListener.onLocationChanged(location);
  }

  public void onProviderDisabled(String provider){}
  public void onProviderEnabled(String provider) {}
  public void onStatusChanged(String provider, int status, Bundle
extras) {}
};

// GPS location listener
private final LocationListener gpsLocationListener = new
LocationListener() {
  public void onLocationChanged(Location location) {

   //location.getProvider() will return which provider
supplied this location

//Logic when a location is found

   if ((long)Math.floor(SystemClock.elapsedRealtime()/1000) -
locationTimeElapse  7)
   {
locationTimeElapse =
(long)Math.floor(SystemClock.elapsedRealtime()/1000);
currentLocationAccuracy += 10;
if (locationAccuracy  1500f)
{
currentLocationAccuracy = 1500f;
}
   }

   if (location.getAccuracy()  30.0 || location.getAccuracy() =
currentLocationAccuracy)
   {
currentLocationAccuracy = location.getAccuracy();
//and other junk happens
   }

 }

  public void onProviderDisabled(String provider){}
  public void onProviderEnabled(String provider) {}
  public void onStatusChanged(String provider, int status, Bundle
extras) {}
};

On Jul 10, 9:13 pm, drpickett davidrpick...@gmail.com wrote:
  Maybe I
  can be choosy and say that if it GPS then I demand 20 meter accuracy
  but if it is network then I only demand 500 meter???

 Chuck Norris can demand a certain accuracy from GPS - You can't -
 GPS reports its accuracy to you - It is a function of the number of
 satellites in view, and other stuff

 dp

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: GPS accuracy reliability

2010-07-14 Thread u1663097 u1663097
-- When it tells me my location is hundreds of miles from where I actually
am, will the call
-- to getAccuracy return hundreds of thousands of meters?

With my experience, sometimes I got a accuracy
of 10M, actually 100m away from where I was.



On Thu, Jul 15, 2010 at 1:01 PM, jgostylo jgost...@gmail.com wrote:

 drpickett:
 When I say I demand a certain accuracy from the GPS what I mean is
 that when it reports a location I call getAccuracy and if it is not
 good enough I throw away the result.  Maybe I should just be more
 lenient on the accuracy from a network location.

 All of this and people have only sort of answered my question.  I
 understand that the answer may just be I don't really know what it
 would do and I understand that really isn't an answer people post on
 the forum because it does not fill the information gap.  The accuracy
 is a function of the number of satellites in view and other stuff.  I
 get that.  But the question remains the same.  When it tells me my
 location is hundreds of miles from where I actually am, will the call
 to getAccuracy return hundreds of thousands of meters?


 PsuedoCode for the previous request (may be missing and spotty but you
 get the gist):

 public class ContainerClass extends Activity

  onCreate(Bundle savedInstanceState)
  {
...
lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
Criteria myCriteria = new Criteria();
myCriteria.setAccuracy(Criteria.ACCURACY_FINE);

providerList = lm.getProviders(true);

for (String provider : providerList)
{
  if (provider.equals(LocationManager.GPS_PROVIDER))
  {
lm.requestLocationUpdates(provider, 7000, 20, gpsLocationListener);
  }
  else if (provider.equals(LocationManager.NETWORK_PROVIDER))
  {
lm.requestLocationUpdates(provider, 7000, 20,
 networkLocationListener);
  }
}
  }

 // Wireless location listener
private final LocationListener networkLocationListener = new
 LocationListener() {
  public void onLocationChanged(Location location) {

 ContainerClass.this.gpsLocationListener.onLocationChanged(location);
  }

  public void onProviderDisabled(String provider){}
  public void onProviderEnabled(String provider) {}
  public void onStatusChanged(String provider, int status, Bundle
 extras) {}
};

 // GPS location listener
private final LocationListener gpsLocationListener = new
 LocationListener() {
  public void onLocationChanged(Location location) {

   //location.getProvider() will return which provider
 supplied this location

//Logic when a location is found

   if ((long)Math.floor(SystemClock.elapsedRealtime()/1000) -
 locationTimeElapse  7)
   {
locationTimeElapse =
 (long)Math.floor(SystemClock.elapsedRealtime()/1000);
currentLocationAccuracy += 10;
if (locationAccuracy  1500f)
{
currentLocationAccuracy = 1500f;
}
   }

   if (location.getAccuracy()  30.0 || location.getAccuracy() =
 currentLocationAccuracy)
   {
currentLocationAccuracy = location.getAccuracy();
//and other junk happens
   }

 }

  public void onProviderDisabled(String provider){}
  public void onProviderEnabled(String provider) {}
  public void onStatusChanged(String provider, int status, Bundle
 extras) {}
};

 On Jul 10, 9:13 pm, drpickett davidrpick...@gmail.com wrote:
   Maybe I
   can be choosy and say that if it GPS then I demand 20 meter accuracy
   but if it is network then I only demand 500 meter???
 
  Chuck Norris can demand a certain accuracy from GPS - You can't -
  GPS reports its accuracy to you - It is a function of the number of
  satellites in view, and other stuff
 
  dp

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: GPS accuracy reliability

2010-07-12 Thread andrew android
Hi!  Could you provide some sample code for verifying which they are
getting results from (gps vs. Network)?

Thanks so much!

On Jul 10, 11:07 am, jgostylo jgost...@gmail.com wrote:
 In answer to some questions.  I am setting up the network location
 finder and theGPSlocation finder using 2 separate
 LocationListeners.  I have some logic that determines what the user
 has activated so I only listen togpsif the havegpsenabled and so
 forth.

 From my user feedback it seems like the biggest location discrepancies
 happen withGPS.  I have not been able to personally verify this.  I
 don't need to be super picky about how accurate it is (500 meters
 would suffice).  I am just wondering ifGPSis putting people several
 hundred miles away from their actual location is it also reliable to
 say that its accuracy is over 200,000 meters?  That way I can throw
 out anything that says it is less accurate than 500 meters.

 If it is putting my user 200 miles away and saying that it thinks its
 accuracy is within 100 meter then it really does me no good.  Maybe I
 can be choosy and say that if itGPSthen I demand 20 meter accuracy
 but if it is network then I only demand 500 meter???

 Thanks for the responses.

 On Jul 10, 10:19 am, Maps.Huge.Info (Maps API Guru)



 cor...@gmail.com wrote:
  You can manage the orientation changes yourself and eliminate this
  source of device confusion, it's quite easy, just add
  android:configChanges=orientation to your manifest's activity.

  As for the signal source, just make sure to check your provider for
  gps - if it saysgps, it will be from that source.

  -John Coryat

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: GPS accuracy reliability

2010-07-12 Thread drpickett
 Maybe I
 can be choosy and say that if it GPS then I demand 20 meter accuracy
 but if it is network then I only demand 500 meter???

Chuck Norris can demand a certain accuracy from GPS - You can't -
GPS reports its accuracy to you - It is a function of the number of
satellites in view, and other stuff

dp

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: GPS accuracy reliability

2010-07-10 Thread Pent
 2) in the backend applcation - Trains travel on tracks (hopefully) so
 ignore all GPS positions that we cannot map on to a track.

Oh I'm highly jealous, wish I could filter on tracks as well.

Pent

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: GPS accuracy reliability

2010-07-10 Thread RichardC
Get enough data sets and you know where the tracks are :)

On Jul 10, 12:15 pm, Pent lee.wil...@googlemail.com wrote:
  2) in the backend applcation - Trains travel on tracks (hopefully) so
  ignore all GPS positions that we cannot map on to a track.

 Oh I'm highly jealous, wish I could filter on tracks as well.

 Pent

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: GPS accuracy reliability

2010-07-10 Thread JP

That was my thought. Unless location provider registration is managed
through the variety of app lifecycle state changes, it is easy to put
an app in a state where it acquires the device location using Network
based location providers, even though the user selected GPS and
unselected everything else (Namely, Use wireless networks:). The
downside of unregistering and registering location providers with
every lifecycle state change (i.e. in onPause(), onResume() and so
forth) is when users manically switch device orientation back and
forth. This leads to a series of lifecycle breakdown and restart calls
that seem to have the potential of getting Android location provider
registration confused. If you haven't done already, I'd recommend to
experiment with this for a few hours to get a feel how it all plays
out in relation to your apps.


On Jul 9, 7:50 am, Maps.Huge.Info (Maps API Guru) cor...@gmail.com
wrote:
 Question: How are you getting your location fix? Are you using
 ACCURACY_FINE and assuming it will use the GPS? Unless you
 specifically test for the provider being GPS, it might default to
 network, which would give you a position with limited accuracy. I've
 seen this bouncing around effect when the wireless location (network)
 provider is trying to figure out where the device is, as it zeros in
 on the location, it can hop all over the map.

 Bottom line: Don't assume that ACCURACY_FINE will be GPS, unless you
 have GPS satellites in view and the user has enabled GPS, you'll be
 using the network location service instead.

 -John Coryat

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: GPS accuracy reliability

2010-07-10 Thread Maps.Huge.Info (Maps API Guru)
You can manage the orientation changes yourself and eliminate this
source of device confusion, it's quite easy, just add
android:configChanges=orientation to your manifest's activity.

As for the signal source, just make sure to check your provider for
gps - if it says gps, it will be from that source.

-John Coryat

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: GPS accuracy reliability

2010-07-10 Thread jgostylo
In answer to some questions.  I am setting up the network location
finder and the GPS location finder using 2 separate
LocationListeners.  I have some logic that determines what the user
has activated so I only listen to gps if the have gps enabled and so
forth.

From my user feedback it seems like the biggest location discrepancies
happen with GPS.  I have not been able to personally verify this.  I
don't need to be super picky about how accurate it is (500 meters
would suffice).  I am just wondering if GPS is putting people several
hundred miles away from their actual location is it also reliable to
say that its accuracy is over 200,000 meters?  That way I can throw
out anything that says it is less accurate than 500 meters.

If it is putting my user 200 miles away and saying that it thinks its
accuracy is within 100 meter then it really does me no good.  Maybe I
can be choosy and say that if it GPS then I demand 20 meter accuracy
but if it is network then I only demand 500 meter???

Thanks for the responses.

On Jul 10, 10:19 am, Maps.Huge.Info (Maps API Guru)
cor...@gmail.com wrote:
 You can manage the orientation changes yourself and eliminate this
 source of device confusion, it's quite easy, just add
 android:configChanges=orientation to your manifest's activity.

 As for the signal source, just make sure to check your provider for
 gps - if it says gps, it will be from that source.

 -John Coryat

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: GPS accuracy reliability

2010-07-09 Thread Justin Edwards
I have had the same reports from my user community within my GPS
application for Android.

In my support emails I have been telling them that it is most likely a
hardware/OS issue, and a hard reset (battery pull) should fix it.  I
have had a few users reply back and said that has fixed it.

I think this may be a issue with the API that is is providing use the
wrong information when we request it.

In my eyes I see this as a bug with Android if it provides the wrong
information once we request it.

Justin

On Jul 9, 8:48 am, jgostylo jgost...@gmail.com wrote:
 This is a general question about GPS accuracy reporting based on
 feedback from my user community.

 My app has an issue where many players get bounced all over kingdom
 come when using GPS to get a signal.  I had this issue with my G1 on
 occasion but not on my Nexus One.  I am talking hundreds of miles from
 their real location.  I changed the code to throw out anything that
 was not at least 500 meters accurate.  My question is, if the location
 placement is hundreds of miles off, how reliable will the accuracy
 reporting be?  Does it realize that it could be hundreds of miles off?

 I am asking the community because I cannot reproduce the scenario with
 what I currently have so I can't test if my fix is meaningful.  Does
 GPS know when its readings are that far off?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: GPS accuracy reliability

2010-07-09 Thread Maps.Huge.Info (Maps API Guru)
Question: How are you getting your location fix? Are you using
ACCURACY_FINE and assuming it will use the GPS? Unless you
specifically test for the provider being GPS, it might default to
network, which would give you a position with limited accuracy. I've
seen this bouncing around effect when the wireless location (network)
provider is trying to figure out where the device is, as it zeros in
on the location, it can hop all over the map.

Bottom line: Don't assume that ACCURACY_FINE will be GPS, unless you
have GPS satellites in view and the user has enabled GPS, you'll be
using the network location service instead.

-John Coryat

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: GPS accuracy reliability

2010-07-09 Thread RichardC
A GPS fix can be inaccurate - no matter how confident the GPS
device is :)

My experience here is from GPS units mounted on multiple trains
travelling about the UK, recording their position every few seconds.
A small percentage of the values we recieved from the GPS units were
completly un-trustworthy (ie. the train would have had to do over
200mph to get between the last fix and the current positon). For a
similar small percentage the train was NOT on a track!

We realised we had to sanitise the data returned from the GPS units.
We did this at 2 levels:

1) on the Train - no point processing (storing) a GPS position when
the calcuated speed (NOT the speed from the GPS unit but calculated by
us from the previous good fix) was totally unreasonable.

2) in the backend applcation - Trains travel on tracks (hopefully) so
ignore all GPS positions that we cannot map on to a track.

Conslusion - a single GPS position should NOT be used at the
application level unless it makes sense - for a given value of
sanity :)

/Richard

On Jul 9, 3:50 pm, Maps.Huge.Info (Maps API Guru) cor...@gmail.com
wrote:
 Question: How are you getting your location fix? Are you using
 ACCURACY_FINE and assuming it will use the GPS? Unless you
 specifically test for the provider being GPS, it might default to
 network, which would give you a position with limited accuracy. I've
 seen this bouncing around effect when the wireless location (network)
 provider is trying to figure out where the device is, as it zeros in
 on the location, it can hop all over the map.

 Bottom line: Don't assume that ACCURACY_FINE will be GPS, unless you
 have GPS satellites in view and the user has enabled GPS, you'll be
 using the network location service instead.

 -John Coryat

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en