现在的位置: 首页 > 综合 > 正文

What do the proximity and orientation sensors in the iPhone do?

2013年08月16日 ⁄ 综合 ⁄ 共 1418字 ⁄ 字号 评论关闭

The proximity sensor in an iPhone senses how close the iPhone is to the
user's cheek/face, so that it can pause whatever activity it is in the
middle of (playing music or browsing the web, for example) so the user
can take a phone call. When the iPhone is removed from the ear after
the call, the iPhone resumes its previous activity.

---

The orientation sensor (accelerometer) works very much like the
same sensor in a digital camera that gauges what orientation the unit
is being held so that it can rotate the display for optimal viewing.

 

Here are a couple of real-world examples of the accelerometer at work:

 

  • You're looking at your photos on an iPhone - you can hold
    the iPhone vertically for portrait-oriented (taller than wide) photos,
    and horizontally for landscape-oriented (wider than tall) photos, and
    they will stretch to fill the screen.

 

  • You're browsing the web, and you come across a site that
    features a lot of text (a news site, for example). It all shows up when
    you hold the iPhone vertically, but you can't read it because the text
    is so small. Rotate the iPhone 90 degrees, and the page will adjust to
    fill the width of the longer dimension of the screen, making the text
    much more legible.
距离传感器用来感知手机和人体间的距离。常见的用途是检测手机和人的面部的距离,假设这样一种情景:你正在听歌或者浏览网页,这时候当你将手机贴近面部的时候距离传感器便会感知到从而暂停音乐播放或者暂停网页浏览。而当你将手机移开耳朵的时候距离传感器也会感知到这个情况,从而唤醒刚才被暂停的活动。
确切的说,重力传感器并并不是方位传感器。但是上面的英文貌似认为重力传感器和方位传感器是一样的(这也许是翻译的问题)。我认为方位传感器应该是指南针,但我目前还没有确认这个东西。
重力传感器在手机上是用于判断该手机当前的状态的,如:手机有六个面,我们可以把这六个面依次朝下放在桌子上,那么gSensor都可以感知到目前手机到底是怎么放置的!

抱歉!评论已关闭.