Class: iPhone Development For Web Programmers March 24-25, Raleigh/Durham

Google Using Undocumented iPhone API Features

by Peter Cooper on November 21, 2008 · 3 comments

iphonesensor.jpg

John Gruber has written about how Google’s Mobile App is using “private iPhone APIs” to access proximity sensor information. While using Google’s app, you can place the phone to your ear to initiate an audio search. It’s a nifty feature, but:

[T]he only thing apps can do with the proximity sensor is turn it on and off. [..] An app can check the status of this property (is it on or off?), and can toggle it, but that’s it. After an app has turned the proximity sensor on, the app never finds out when or if it has actually been engaged. There is no way for an app to be notified when the proximity sensor has been triggered. No way, that is, via the public APIs.

Gruber goes on to hint that after a little “work” he’s found a method called proximityStateChanged that can be used to detect when the proximity sensor is tripped. As an undocumented method, he concludes that Google might be getting favorable treatment in being able to use private APIs “just because they’re Google.”

Ross Boucher, founder of 280 North, came back with an interesting blog post called Google, iPhone, and Thinking Like a Programmer where he came up with an alternative technique to detect proximity to the iPhone - with code (and even a full app) included. Despite his clever workaround, Boucher thinks that if Google and some other vendors have been given special dispensation to use special iPhone features, it’s a reasonable tradeoff.

{ 3 trackbacks }

New In iPhone 3.0 Tutorial Series, Part 4: Proximity Monitoring
07.21.09 at 12:21 pm
Tutorial: Proximity Monitoring at Under The Bridge
07.21.09 at 3:16 pm
iPhoneGeek 爱疯极客 » iPhone 3.0新特性系列教程之四 – 临近监测
11.28.09 at 5:42 am

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Older post: Jiggy: Develop Native iPhone Apps in JavaScript

Newer post: Interview with Neil Mix of Pandora - iPhone Audio Streaming, Memory Management, and More