Android 2.3 说明
The sections below provide a technical overview of what's new for developers in 2.3, including new features and changes in the framework API since the previous version.下面的章节将提供一个什么样的为2.3开发,包括新的功能和框架API的变化,因为以前的版本的新技术概述。
SIP-based VoIP基于SIPVoIP
The platform now includes a SIP protocol stack and framework API that lets developers build internet telephony applications.该平台现在包括一个SIP协议栈和框架的API,让开发人员建立的互联网电话应用。 Using the API, applications can offer voice calling features without having to manage sessions, transport-level communication, or audio — these are handled transparently by the platform's SIP API and services.使用API,应用程序可以提供,而无需管理会话,传输层次的沟通,或音频语音通话功能 - 这是处理平台的SIP API和服务透明。
The SIP API is available in the android.sip package. SIPAPI是提供android.sip包。 The key class is SipManager , which applications use to set up and manage SIP profiles, then initiate audio calls and receive audio calls.重点班是SipManager ,使用的应用程序设置和管理园区概况,然后启动音频电话和接收音频呼叫。 Once an audio call is established, applications can mute calls, turn on speaker mode, send DTMF tones, and more.一旦音频呼叫建立,应用程序可以静音通话,在扬声器模式下打开,发送DTMF音,等等。 Applications can also use the SipManager to create generic SIP connections.应用程序也可以使用SipManager创建通用的SIP连接。
The platform's underlying SIP stack and services are available on devices at the discretion of the manufacturer and associated carrier.该平台的底层SIP协议栈和服务都在制造商和运营商自行决定相关设备。 For this reason, applications should use the isApiSupported() method to check whether SIP support is available, before exposing calling functionality to users.出于这个原因,应用程序应该使用isApiSupported()方法检查是否可用用户的SIP支持,才露出调用功能。
To use the SIP API, applications must request permission from the user by declaring <uses-permission android:name="android.permission.INTERNET"> and <uses-permission android:name="android.permission.USE_SIP"> in their manifest files.使用SIP API,应用程序必须请求许可声明用户可以通过<uses-permission android:name="android.permission.INTERNET"><uses-permission android:name="android.permission.USE_SIP">在清单文件。
Additionally, developers can request filtering on Android Market, such that their applications are not discoverable to users whose devices do not include the platform's SIP stack and services.此外,开发人员可以在Android市场要求,筛选,这样他们的应用程序不被查到用户的设备不包括平台的SIP协议栈和服务。 To request filtering, add <uses-feature android:name="android.software.sip" android:required="true"> and <uses-feature android:name="android.software.sip.voip"> to the application manifest.要求过滤,添加<uses-feature android:name="android.software.sip" android:required="true"><uses-feature android:name="android.software.sip.voip">到应用程序舱单。
Near Field Communications (NFC)近场通信(NFC
Android 2.3 includes an NFC stack and framework API that lets developers read NDEF tags that are discovered as a user touches an NFC-enabled device to tag elements embedded in stickers, smart posters, and even other devices. Android2.3包括一个NFC栈和框架的API,让开发人员阅读是发现了作为一个用户触摸具有NFC功能的设备,在不干胶标签,智能海报嵌入式元素,甚至其他设备NDEF标签。
The platform provides the underlying NFC services that work with the device hardware to discover tags when they come into range.该平台提供了基本的NFC服务,硬件与设备工作时,发现他们进入标签范围来。 On discovering a tag, the platform notifies applications by broadcasting an Intent, appending the tag's NDEF messages to the Intent as extras.在发现了一个标签,该平台通过广播通知一个Intent,附加标签的NDEF消息,作为临时演员意向申请。 Applications can create Intent filters to recognize and handle targeted tags and messages.应用程序可以创建过滤器,意图识别和处理有针对性的标签和消息。 For example, after receiving a tag by Intent, applications extract the NDEF messages, store them, alert the user, or handle them in other ways.例如,在收到意向的一个标记,应用程序提取NDEF消息,存储它们,提醒用户,或以其他方式处理。
The NFC API is available in the android.nfc package. NFCAPI是提供android.nfc包。 The key classes are:关键类是:
NfcAdapter , which represents the NFC hardware on the device. NfcAdapter ,它代表了NFC的硬件设备。
NdefMessage , which represents an NDEF data message, the standard format in which "records" carrying data are transmitted between devices and tags. NdefMessage ,它代表一个NDEF数据电文的,该标准格式,其中记录标签进行数据传输和设备之间。 Applications can receive these messages from ACTION_TAG_DISCOVERED Intents.应用程序可以接收信息从这些ACTION_TAG_DISCOVERED意图。sdk
NdefRecord , delivered in an NdefMessage , which describes the type of data being shared and carries the data itself. NdefRecord ,一交付NdefMessage ,它描述了数据共享的类型,并进行数据本身。
NFC communication relies on wireless technology in the device hardware, so support for the platform's NFC features on specific devices is determined by their manufacturers. NFC的通信依赖于硬件设备的无线技术,因此支持该平台的NFC具体设备制造商的决定是由他们的特点。 To determine the NFC support on the current device, applications can call isEnabled() to query the NfcAdapter .要确定当前的设备上支持NFC技术,应用程序可以调用isEnabled()来查询NfcAdapter The NFC API is always present, however, regardless of underlying hardware support. NFCAPI是始终存在,但是,不管底层的硬件支持。
To use the NFC API, applications must request permission from the user by declaring <uses-permission android:name="android.permission.NFC"> in their manifest files.要使用NFCAPI,应用程序必须请求许可声明用户可以通过<uses-permission android:name="android.permission.NFC">在清单文件。
Additionally, developers can request filtering on Android Market, such that their applications are not discoverable to users whose devices do not support NFC.此外,开发人员可以在Android市场的要求,使得他们的应用程序不会对用户的发现的设备不支持NFC的筛选。 To request filtering, add <uses-feature android:name="android.hardware.nfc" android:required="true"> to the application's manifest.要求过滤,添加<uses-feature android:name="android.hardware.nfc" android:required="true">到应用程序的清单。
Gyroscope and other sensors陀螺仪和其他传感器
Android 2.3 adds platform and API support for several new sensor reading types — gyroscope, rotation vector, linear acceleration, gravity, and barometer. Android的平台和API 2.3增加了几个新的阅读类型的传感器支持 - 陀螺仪,旋转向量,线性加速,重力和晴雨表。 Developers can use the new sensor readings to create applications that respond quickly and smoothly to precise changes in device position and motion.开发人员可以使用新的传感器读数来创建应用程序响应迅速,顺利,在设备的位置和运动的精确变化。 The Sensor API reports gyroscope and other sensor changes to interested applications, whether they are running on the application framework or in native code.陀螺仪传感器空气污染指数报告和其他传感器的变化感兴趣的应用程序,无论是在应用程序框架内或在本地代码运行。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。