Alex Rivera | Logout

iPhone Proximity Sensor

Asked 2008-10-03T03:06:11.550
20

Can the iPhone SDK take advantage of the iPhone's proximity sensors? If so, why hasn't anyone taken advantage of them? I could picture a few decent uses.

For example, in a racing game, you could put your finger on the proximity sensor to go instead of taking up screen real-estate with your thumb. Of course though, if this was your only option, then iPod touch users wouldn't be able to use the application.

Does the proximity sensor tell how close you are, or just that something is in front of it?

Edit
Report

2 Answers

0

@Dipak Patel & @Coderer

You can download working code at http://spazout.com/google_cheats_independent_iphone_developers_screwed

It has a working implementation of proximityStateChanged a undocumented method in UIApplication.

Hope this helps.

answered 2008-11-20T04:17:55.713
0

To turn the screen off it's conceivable that more than one sensors is used to figure out if the screen should be turned off or not. The IR proximity sensor described by Cryptognome in conjunction with the Touch screen sensor described by Peter Wone could work out if the iphone is being held close to your face (or something else with a slight electric charge) or if its just very close to something in-animate.

answered 2009-10-03T12:07:38.793

Your Answer