[Geowanking] getting phone GPS data from a Java app

Joe Germuska Joe at Germuska.com
Tue Dec 30 11:10:06 PST 2003


>Again - as far as I can tell:  The real meat of doing a location based
>query is that one has to take some information from ones own cellphone,
>open an http connection to some location server, give it that information,
>and have it give you back your location... for a fee.  I don't see JSR179
>eliminating the fee part of this...

I don't see why you have to use http, or why you generally need to go 
back to any server.  I mean, yes, in theory you could call GPS 
satellites "servers," but within the Location API, it's simply left 
as unimportant to the application developer what the source of the 
data is.   Here's a snip from the package overview page:

>The LocationProvider class represents a module that is able to 
>determine the location of the terminal. This may be implemented 
>using any possible location methods, for example, satellite based 
>methods like GPS, cellular network based methods, short-range 
>positioning methods like Bluetooth Local Positioning, etc. The 
>implementation may also combine the methods in various ways to get 
>the optimal result.

What's not clear (from the JavaDoc, at least), is how various 
LocationProvider implementations are registered so that the static 
getInstance(Criteria) method has any from which to choose.  The 
application developer can use the Criteria class to set minimum 
tolerances for accuracy, and note that the Criteria class includes a 
"no cost to end user" criteria -- a tiny detail, but perhaps relevant 
to the question of whether or not the mfr's are going to stick it to 
the users with licensed services.

 From the API doc for the Criteria class:
>However, the cost criteria field is treated differently from others. 
>If the application has set the cost field to indicate that the 
>returned location provider is not allowed to incur financial cost to 
>the end user, the implementation MUST guarantee that the returned 
>location provider does not incur cost.


Anselm wrote:
>It is not obvious to me how to write the server end myself...  since that
>in turn seems to imply access to protected information.  Conceivably one
>could take the cell tower ids and signal strength and write ones own
>server...  I don't think that's a reasonable effort though.

You are correct that the whole API is predicated on the hardware 
dealing with the details of getting coordinates.  The point is 
abstracting the details of how the location information is gathered 
so that one can write portable location-aware applications that run 
on any location-enabled J2ME runtime, no matter who manufactured it.

I don't know much about hardware at all, so I was ready to accept my 
need to have someone else be my "LocationProvider" -- but if you do 
figure out how to hack the phones to get the geo-info, I don't see 
why you couldn't write your own LocationProvider on top of that, if 
you were so inclined (and if you could figure out the mystery of 
registering it!)

Joe

-- 
Joe Germuska            
Joe at Germuska.com  
http://blog.germuska.com    
  "We want beef in dessert if we can get it there."
   -- Betty Hogan, Director of New Product Development, National 
Cattlemen's Beef Association




More information about the Geowanking mailing list