Thanks in advance.
I got the information about the iphone sensors from http://ipod.about.com/od/ipodiphonehardwareterms/qt/iphone-sensors.htm. But I didn't get information about how to use ambient sensor in iphone
Here's a link to a description of the ambient light sensor hardware with example code that shows how to access it.
It is possible, and the framework is public.
You can activate the connection to the sensor like so :
[[UIDevice currentDevice] setProximityMonitoringEnabled:YES];
BTW, it doesn't seem to be using the light sensor, because proximity sensing would tweak out in a dark room.
However, the API call basically blanks the screen when you hold the phone up to your face. Not useful for interaction, sadly.
Here is a guide about iPhone sensors : iPhone sensors
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With