GPS Requires Network??

  • Thread starter Lawrence D'Oliveiro
  • Start date
B

Bent C Dalager

I wrote a simple test program to dump out info about all the
LocationProviders on my HTC Desire (Android 2.2) as per these calls
<http://developer.android.com/reference/android/location/LocationProvider.html>.

For the GPS provider, requiresSatellite() returns true as you would expect.
But so does requiresNetwork()!

Why would GPS require a network connection?

If LocationProvider provides both fine grain and coarse grain
localisation services, then it uses GPS for the fine grain
localisation which obviously requires access to the satellite
receiver; and it reads nearby WiFi SSIDs to calculate coarse grain
localisation which requires access to the WiFi radio.

I understand that coarse localisation also uses cell tower IDs though,
not sure how this fit into the required permissions.

Cheer,
Bent D
 
L

Lawrence D'Oliveiro

If LocationProvider provides both fine grain and coarse grain
localisation services, then it uses GPS for the fine grain
localisation which obviously requires access to the satellite
receiver; and it reads nearby WiFi SSIDs to calculate coarse grain
localisation which requires access to the WiFi radio.

There is a separate LocationProvider called “networkâ€, that says it requires
both a cellular network (requiresCell()) and data network
(requiresNetwork()). That provides lower accuracy than GPS, so there’s no
reason for the GPS provider to do the coarse-grained stuff as well.
 
L

Lawrence D'Oliveiro

Why would GPS require a network connection?

Doesn’t matter. The GPS works. I wrote a simple test program, which
registers a listener for updates, and it is getting fixes just fine.
 
L

Lawrence D'Oliveiro

LocationManager.getGpsStatus only returns useful satellite data when called
from within a GpsStatus.Listener callback. Oddly, GpsSatellite.usedInFix is
always returning false for all satellites.

<http://developer.android.com/reference/android/location/GpsSatellite.html>

I’m assuming that GpsSatellite.getSnr is in dB. The numbers range from
around 11 to 20. Is getPrn some kind of unique satellite ID?

One interesting omission is, there seems to be no way to get the time as
reported by GPS.
 
L

Lawrence D'Oliveiro

Oddly, GpsSatellite.usedInFix is always returning false for all
satellites.

No, it does return true for those satellites used for the fix. Which is not
necessarily all of them, and not necessarily even the ones with the
strongest signals.
 
R

Roedy Green

I wrote a simple test program to dump out info about all the
LocationProviders on my HTC Desire (Android 2.2) as per these calls
<http://developer.android.com/reference/android/location/LocationProvider.html>.

For the GPS provider, requiresSatellite() returns true as you would expect.
But so does requiresNetwork()!

Why would GPS require a network connection?

I'll make a stab that there is a common API that works either by
asking the network for information gleaned from tower triangulation or
from an onboard GPS unit. If you don't have a GPS you can get a rough
location.

Perhaps part of the API turns the latitude and longitude into map
information which would require the net if the phone did not have the
maps loaded.

Perhaps the two schemes back each other up when the other is not
working for some reason.

It seems unlikely, but perhaps the phone does not do the GPS
calculations. It sends the raw data to a computer for number
crunching.

The answer may be gleaned by having a look at what other services the
API offers.
 
L

Lew

Roedy said:
Lawrence D'Oliveiro wrote, quoted or indirectly quoted someone who said :
I'll make a stab that there is a common API that works either by
asking the network for information gleaned from tower triangulation or
from an onboard GPS unit. If you don't have a GPS you can get a rough
location.

Perhaps part of the API turns the latitude and longitude into map
information which would require the net if the phone did not have the
maps loaded.

Perhaps the two schemes back each other up when the other is not
working for some reason.

It seems unlikely, but perhaps the phone does not do the GPS
calculations. It sends the raw data to a computer for number
crunching.

The answer may be gleaned by having a look at what other services the
API offers.

Maybe the application wishes to glean gobs of private, personal data via your
WiFi connection while you think it's innocently telling you how to find the
Gucci store.
 
D

Daniele Futtorovic

Why would comp.lang.java.programmer be the place to ask?

Buggered if I know why, but I can't help this feeling of uneasiness when
I hear that Lawrence is doing things involving satellites.
 
T

Tom Anderson

I wrote a simple test program to dump out info about all the
LocationProviders on my HTC Desire (Android 2.2) as per these calls
<http://developer.android.com/reference/android/location/LocationProvider.html>.

For the GPS provider, requiresSatellite() returns true as you would expect.
But so does requiresNetwork()!

Why would GPS require a network connection?

I think you have your answer to this, but i'll add another point - there
may be supplementary information that the phone can obtain from the
network to improve its GPS performance:

http://en.wikipedia.org/wiki/Assisted_GPS

GPS would still work without network access, but be less accurate or
slower to fix.

tom
 
L

Lawrence D'Oliveiro

Buggered if I know why, but I can't help this feeling of uneasiness when
I hear that Lawrence is doing things involving satellites.

Aren’t these little Java kiddies cute? Maybe someday they’ll grow up and
learn to write real programs...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,787
Messages
2,569,627
Members
45,328
Latest member
66Teonna9

Latest Threads

Top