Sunday, November 8, 2009

Android Location APIs and why they anger me

The problem lies in the fact that as a end-developer I have to care about the various location inputs on a phone. I have to think about GPS vs Wifi vs Cell Tower LocationProviders in order to really take advantage of the phone's location capabilities. What basically happened was that my algorithm for picking a users location based on incoming location updates caused more accurate but out of date location updates to be preferred over slightly less accurate but much more recent updates.


I basically have to deal with the fact that I might get location-from-gps after I get location-from-wifi-tower OR i might  get location-from-wifi-tower after I get location-from-gps so that the Last Known location may in some cases return a more or less accurate location than what the phone is really capable of reporting just because I wanted to be able to get a quick-kind-of-accurate-lock while I was trying to accquire a accurate-as-possible sort of lock.

How would I make this better?

I could see an API where instead of registering with individual location providers, you would query the system for a set of location updates. You would define that you want FINE location, but will accept COARSE updates first. You would have a getBestKnownLocation instead of a getLastKnownLocation that would return a location based on heuristics you might define when registering your location provider.  Visually, the updates you'd receive would look something like the growing/shrinking circles you get in the gmaps app when honing in on a location. Maybe the developer would request a "HyperLocalWhileWalkingAround" strategy that could be swapped with "PassiveUpdatesWhenLocationIsSignificentlyChanged." both of which could have knobs for controlling specifics of the strategy.

In short, I want to abstract away the code I have shown as an example above. As a end-developer, I don't care where the location comes from, just that I get a location but I do care, what the data looks like.


Monday, November 2, 2009

Nine days of Nolstaga

I had a very special nine days in the Midwest. Probably some of the best nine days in the Midwest that I can remember. Things:

  1. Concert with Chris - We've been seeing shows together for almost 10 years, and its been 8 since we first saw The Lawrence Arms opening for Alkaline Trio at the 2001 Halloween show. Just wow.
  2. Zombie Crawl with Chris, Andy, Jared and others - All sorts of DSF/Chicago drinking memories coming back to life.
  3. Week at home with family - Good to see everyone. I got a night out with my brother, mom and dad. Would have been nice to spend some time with Deni, but she was sick and then back at school.
  4. Driving to Michigan with Chris and Football Master - I spent years making trips to Michigan with Chris and many others. Doing it again, despite the 6 hour drive there, was fun -- I can feel you breathing.
  5. Halloween Parties in Michigan - I hope that there are and that there are not photos of the hyjinx that ensued Friday Night to Sunday afternoon. Great times with great people.
I swear that every time I go to the midwest its going to be my last social visit. I don't know when that will ever really happen though. Every time I go, I leave hoping that the next trip will be as good as the trip just ending.