January 2009


How A-GPS Works

Peter McCurdy, 12 January 2009

To follow up on how the iPhone gets its location, Ars Technica recently did an article on how A-GPS works under the hood – this is what the iPhone uses, as do many other devices. Aside from anything else, it explains why old GPS receivers would take ages to get an initial location, and how newer ones manage to be faster.

How the iPhone Obtains Its Location

Peter Zion, 7 January 2009

I was recently talking with someone about what was possible with the location discovery support on the iPhone, and it became clear that I needed to explain exactly what the iPhone is doing when you ask for its location.  I’m cross-posting here for future reference.

Here’s how the iPhone obtains its location: it has three different ways of figuring out where it is, and it basically tries all three at the same time and sends you updates if it has a more accurate estimate of the location.

The first way it discovers its location, of course, is the GPS.  The GPS is very accurate (it can get down to within a few meters if it’s outdoors and the weather is clear), but it takes a relatively long time to obtain the location (though usually still less than 10 seconds).

The second way is by triangulation based on the cell towers it can talk to.  This accuracy of this method depends on how many cell towers are near you; for one of my colleagues, it’s fairly accurate (within 100m) but for me it’s accurate to only within 2000m or so.

The third method is through wifi; I’m not 100% sure how it works, but certain wifi providers also provide geographic coordinates of where the routers are approximately located.  Presumably they do this somehow by knowing, for instance, where the DSL line terminates. Thus, when you’re connected by Wifi you have additional information about where you’re located, possibly fairly accurate.

Note that the first generation iPhone, which doesn’t have a GPS, still tries to obtain its location using the second and third methods.

All of this is transparent to any iPhone application: you simply ask it to start telling you the location, and it will do so and continue to update you as it gets better estimates or the phone moves a significant distance.  The application has no control over the way the phone obtains its location.

The bad news is that there’s nothing you can do to guarantee that the iPhone will be able to obtain its location while indoors.  It’s not possible; the technology simply isn’t there, not just for the iPhone but for any consumer device.

The good news is that the GPS often works even if you are indoors, as long as you’re reasonably close to a window.  For instance, it works fine from my office, even though the window is about 15 feet away.

Open sourcing our legalese

David Carney, 2 January 2009

Since our inception, we (at Navarra) have always planned to “open source” our legalese.  The motivation is simple: similar to involvement in an open source project, we wish to give something back to the community and, by doing so, facilitate other individuals and groups seeking to establish businesses based on the following principles:

  • Transparency: every member should feel they understand every decision across the company.
  • Shared control: every member should feel they have input into decisions that affect them.
  • Efficiency: non-controversial decisions should be made by a small number of people (ideally, one) quickly without taking everything to a vote.
  • Reliability: the business should stay around even as members come and go. There should be no reason to take external financing, be acquired, or have power struggles, since the company itself should be valueless except as an environment to do work in.

Contrary to what most people think, we’re not a company or a partnership.  Rather, we are a cooperative.  Fundamentally, the difference between a company and a coop is that a company has one vote per share, whereas a coop has one vote per person.  Since a cooperative is also considered a legal person, this allows us to sign group contracts (including non-disclosures and non-competes) so that we may easily leverage each others’ skills and reduce our shared risk to deliver quality software on time.  There are, of course, other salient details but, for a small business, this basically leads to a more collaborative, less politically-charged landscape.  Yes, we have a board of directors that includes a president, vice president, treasurer, and secretary.  Yes, we are definitely for-profit.  But, no, we are not looking for large amounts of investment capital nor to expand rapidly to take over the world.

Over the next few weeks, I plan to start “opening up” our legalese by publishing our charter, standard documents (such as contracts and NDAs), and other useful tidbits of knowledge that we have acquired over 2008.  There’s still some debate on the format, though I’m leaning toward using a public wiki and/or Creative Commons license.  Please stay tuned and, if you have any ideas, comments, or suggestions then please forward them to me at dfcarney@navarra.ca

Michał Zalewski on Browser Security

Peter McCurdy, 2 January 2009

For those who are interested in the security of web browsers (and really, that should be everyone who creates web sites), top-notch security expert Michał Zalewski has recently released a browser security guide covering the current states of all the major browsers.

It’s rather long and thorough, which makes it less suitable for reading beginning to end, but it covers a lot of important stuff, and looks to be a very useful resource. Wondering how the same-origin policy differs between JavaScript code and Flash content, or wondering how third-party cookies are restricted in the various browsers? It’s all in there. The only depressing bit is just how long the document has to be to cover all the various ways security can fail on the web.