"Welcome to Global Forexgroup gasMaking Money Online World."

Search box

0

Google Mobile Uses Private iPhone APIs

Posted by MERONEPAL on 9:35 PM
Google’s just-released and much-publicized update to their Google Mobile iPhone app features some very clever interaction design for the voice search feature. There is an on-screen button you can tap to initiate a voice search manually, but, as illustrated in their example video, you can initiate a voice search just by lifting your iPhone to your ear.

In order to trigger this automatic voice prompt, you must:

  1. Move the iPhone.
  2. Trigger the proximity sensor next to the speaker at the top of the iPhone.

You need to do both, in that order. The voice prompt is never triggered by motion alone, nor by covering the proximity sensor without first having moved the phone. The only way it is triggered is by moving the phone and then triggering the proximity sensor. It’s very clever, and the resulting user experience is very nice.
But here’s the intrigue: There is no public API in the iPhone SDK for using the proximity sensor in this way.
As you might imagine considering the number of accelerometer-driven games in the App Store, there are plenty of public API calls to access data from the iPhone’s accelerometer. But the only thing apps can do with the proximity sensor is turn it on and off. When the proximity sensor is on, the screen turns off and stops accepting touch input when you cover the sensor (typically with your head, when holding the phone to your ear to, say, make a phone call, but you can just as easily trigger it by covering the sensor with your finger). By default, the proximity sensor is turned off, and the overwhelming majority of apps leave it that way.
If you’re a registered iPhone developer, you can read the relevant documentation for the proximitySensingEnabled property in the UIApplication Class Reference. 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.
If you use something like the command-line strings utility to examine the UIKit framework, you can see that there’s an undocumented (and therefore private to Apple) method named proximityStateChanged. And if one were to strip the FairPlay DRM from the current Google Mobile application binary — which, of course, you wouldn’t do, because you’re not supposed to strip FairPlay DRM, but I’m just saying if one were to do this — a class dump of the application binary would show that Google Mobile does in fact implement proximityStateChanged.
So, (a) Google Mobile is using an undocumented API, and (b) to my knowledge, there is no way to duplicate the behavior of Google Mobile’s “just lift the phone to your ear to trigger the voice prompt” feature using only the public APIs in the iPhone SDK. Needless to say, using undocumented APIs violates the iPhone SDK Guidelines. A developer that plays by the rules cannot do what Google is doing.


0 Comments

Post a Comment

Web site Submission

KEWLRANK.COM

free counters

counter

Copyright © 2009 MOBILE AND iPHONE All rights reserved. Theme by MERO NEPAL. | Blog creat by Deepak(aaditya).