Saturday, March 14, 2009

Google’s Mobile App Uses Undocumented API’s to use iPhone’s Proximity Sensor to Prompt a Voice Search

John Gruber of Daring Fireball had done some research and has discovered that Google Engineers have actually used unpublished API’s that officially break Apple’s iPhone SDK agreement.


Goolge spokesperson has also confirmed that they are using undocumented APIs in order to use the iPhone’s proximity sensor to prompt a verbal search.


If you have used Google’s Mobile app, you might have noticed that you have the option to either tap an on-screen button to initiate voice search or you can initiate it by simply bringing your iPhone to your ear which gives the iPhone app a nice touch.


Gruber points out:



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.



However, as per iPhone SDK’s documentation, the only thing iPhone apps can do with the proximity sensors is to turn it on and off. When the proximity sensor is on, the screen is off and when the sensor is off, the screen is on. It also stops accepting touch input when you cover the sensor. You might have noticed this in quite a few iPhone apps like Fring which allow you to make VOIP calls from your iPhone over Wi-Fi.


So an iPhone app can check the status of this sensor and also toggle it but there is no way for the iPhone app to be notified when the sensor is triggered, at least there are no published API’s available to replicate this behavior.


So based on his research Gruber concluded that Google had used an undocumented API in the latest version of its Mobile app.


Gruber was spot on as Cnet later reported:



“A Google spokesman confirmed Tuesday that Google Mobile uses undocumented APIs (application programming interfaces) in order to use the iPhone’s proximity sensor to prompt a verbal search. iPhone developers were only supposed to use the APIs that Apple published in its SDK when they create their applications under the terms of that agreement.


Google has denied, however, a more serious charge that it was linking to private or dynamic frameworks in the Google Mobile application. That’s considered a big no-no in the development community.”



The problem with using undocumented API is that the next firmware update could break the iPhone app if Apple decides to make some changes to the API.


It could also mean that Apple rejects or removes the iPhone App from the App Store like they have done in case of quite a few apps thus forcing Google to modify the functionality of its iPhone app.


I think the fair thing to do would be to publish the API that is being used by Google for its Mobile app so that other iPhone developers can also use it as it definitely enhances the user experience of Google’s app.

0 comments:

Post a Comment