Difference between revisions of "Proximity Sensor"

From WebOS Internals
Jump to navigation Jump to search
(New page: While poking around in '''com.palm.app.crotest''' code I found some code that interacts with the IR proximity sensor. I think quite a few apps could use it as an input, for one the stock "...)
 
m
 
(One intermediate revision by one other user not shown)
Line 4: Line 4:
  
 
I'll try and update this page when I find more information / code examples.
 
I'll try and update this page when I find more information / code examples.
 +
 +
UPDATE: The code in "proximity-assistant.js" does not get any events from the proximity sensor. It is unable to know whether a user has gotten close to the proximity sensor. All it can do is turn the sensor on (and be notified that it successfully set it on). The screen turning off is done by the sensor, NOT by the phone app's code. Unfortunately unless we find a way to get events from the proximity sensor it is effectively useless for apps like the alarm clock suggested above.

Latest revision as of 01:38, 28 April 2010

While poking around in com.palm.app.crotest code I found some code that interacts with the IR proximity sensor. I think quite a few apps could use it as an input, for one the stock "Clock" app can utilize it to control it's alarm / snooze / dismiss functions. I haven't done much with it yet and don't think it would be appropriate to cut-paste code here but if you're interested in exploring this functionality check out:

/usr/palm/applications/com.palm.app.crotest/app/controllers/proximity-assistant.js

I'll try and update this page when I find more information / code examples.

UPDATE: The code in "proximity-assistant.js" does not get any events from the proximity sensor. It is unable to know whether a user has gotten close to the proximity sensor. All it can do is turn the sensor on (and be notified that it successfully set it on). The screen turning off is done by the sensor, NOT by the phone app's code. Unfortunately unless we find a way to get events from the proximity sensor it is effectively useless for apps like the alarm clock suggested above.