android sdk升级说明.doc_第1页
android sdk升级说明.doc_第2页
android sdk升级说明.doc_第3页
android sdk升级说明.doc_第4页
android sdk升级说明.doc_第5页
已阅读5页,还剩8页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Android 2.3 说明The sections below provide a technical overview of whats new for developers in 2.3, including new features and changes in the framework API since the previous version.下面的章节将提供一个什么样的为2.3开发,包括新的功能和框架API的变化,因为以前的版本的新技术概述。 u SIP-based VoIP基于SIP的VoIP 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 platforms SIP API and services.使用API,应用程序可以提供,而无需管理会话,传输层次的沟通,或音频语音通话功能 - 这是处理平台的SIP API和服务透明。 The SIP API is available in the .sip package. SIP的API是提供.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 platforms 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 and in their manifest files.使用SIP API,应用程序必须请求许可声明用户可以通过和在清单文件。 Additionally, developers can request filtering on Android Market, such that their applications are not discoverable to users whose devices do not include the platforms SIP stack and services.此外,开发人员可以在Android市场要求,筛选,这样他们的应用程序不被查找到用户的设备不包括平台的SIP协议栈和服务。 To request filtering, add and to the application manifest.要求过滤,添加和到应用程序舱单。 u 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. Android的2.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 tags 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. NFC的API是提供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意图。 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 platforms 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. NFC的API是始终存在,但是,不管底层的硬件支持。 To use the NFC API, applications must request permission from the user by declaring in their manifest files.要使用NFC的API,应用程序必须请求许可声明用户可以通过在清单文件。 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 to the applications manifest.要求过滤,添加到应用程序的清单。 u 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.陀螺仪传感器空气污染指数报告和其他传感器的变化感兴趣的应用程序,无论是在应用程序框架内或在本地代码运行。 Note that the specific set of hardware sensors available on any given device varies at the discretion of the device manufacturer.请注意,硬件传感器可在任何一组特定的设备在设备制造商自行决定各不相同。 Developers can request filtering in Android Market, such that their applications are not discoverable to users whose devices do not offer a gyroscope sensor.开发人员可以在Android市场要求,筛选,这样他们的应用程序不被查找到用户的设备不提供一个陀螺仪传感器。 To do so, add to the application manifest.为此,添加的应用程序清单。 u Multiple cameras support支持多台摄像机 Applications can now make use of any cameras that are available on a device, for either photo or video capture.应用程序现在可以利用任何相机可在一个设备或者照片或视频拍摄,使用。 The Camera lets applications query for the number of cameras available and the unique characteristics of each.该Camera可让每个应用程序的数量查询相机的独特性和可用。 New Camera.CameraInfo class stores a cameras positional characteristics (orientation, front-facing or back-facing).新Camera.CameraInfo类存储相机的正面)位置特征(方向,前面板或备份。 New getNumberOfCameras() and getCameraInfo() methods in the Camera class let applications query for the cameras available and open the camera that they need.新getNumberOfCameras()和getCameraInfo()的方法, Camera类允许应用程序提供查询的相机并打开相机,他们的需要。 New get() method lets applications retrieve a CamcorderProfile for a specific camera.新get()方法允许应用程序检索CamcorderProfile特定相机。 New getJpegEncodingQualityParameter() lets applications obtain the still-image capture quality level for a specific camera.新getJpegEncodingQualityParameter()使应用程序可以获取静态图像捕捉特定的相机质量水平的。 To look at sample code for accessing a front-facing camera, see CameraPreview.java in the ApiDemos sample application.看样品的代码用于访问前面对镜头,看到CameraPreview.java在ApiDemos示例应用程序。 The Camera API also adds:该相机API还补充说: New parameters for cameras, including focus distance, focus mode, and preview fps maximum/minimum.照相机,包括焦距,对焦模式和预览帧率最高/最低的新参数。 New getFocusDistances() , getPreviewFpsRange() , and getSupportedPreviewFpsRange() for getting camera parameters, as well as setPreviewFpsRange() for setting preview framerate.新getFocusDistances() getPreviewFpsRange()和getSupportedPreviewFpsRange()用于获取摄像机参数,以及setPreviewFpsRange()用于设置预览帧率。 u Mixable audio effects可混合的音频效果 The platforms media framework adds support for new per-track or global audio effects, including bass boost, headphone virtualization, equalization, and reverb.该平台的媒体框架增加了对新的每首曲目或全局音频效果,包括低音增强,耳机虚拟化,均衡和混响支持。 New android.media.audiofx package provides the API to access audio effects.新android.media.audiofx包提供的API来访问的音频效果。 New AudioEffect is the base class for controlling audio effects provided by the Android audio framework.新AudioEffect是音频框架基类所控制的机器人提供的音频效果。 New audio session ID that lets an application associate a set of audio effects with an instance of AudioTrack or MediaPlayer .新的音频会话ID,可以让一个应用程序关联的一组音频效果与实例一AudioTrack或MediaPlayer 。 New AudioTrack class constructor that lets you create an AudioTrack with a specific session ID.新AudioTrack类的构造函数,可以让您创建一个AudioTrack与特定会话的ID。 New attachAuxEffect() , getAudioSessionId() , and setAuxEffectSendLevel() methods.新attachAuxEffect() getAudioSessionId()和setAuxEffectSendLevel()方法。 New attachAuxEffect() , getAudioSessionId() , setAudioSessionId(int) , and setAuxEffectSendLevel() methods and supporting types.新attachAuxEffect() getAudioSessionId() setAudioSessionId(int) ,及setAuxEffectSendLevel()方法和支持的类型。 To look at sample code for audio effects, see AudioFxDemo.java in the ApiDemos sample application.要查看示例效果的音频代码,看到AudioFxDemo.java在ApiDemos示例应用程序。 The media framework also adds:媒体框架还补充说: New support for altitude tag in EXIF metadata for JPEG files.在新的支持JPEG文件的EXIF元数据的高度标记。 New method getAltitude() method to retrieve the value of the EXIF altitude tag.新方法getAltitude()方法来检索值的标签的EXIF高度。 New setOrientationHint() method lets an application tell MediaRecorder of the orientation during video capture.新setOrientationHint()方法让应用程序告诉MediaRecorder的方向在视频捕获。 u Download manager下载管理 The platform includes a new DownloadManager system service that handles long-running HTTP downloads.该平台包括一个新的DownloadManager系统服务,处理长期运行的HTTP下载。 Applications can request that a URI be downloaded to a particular destination file.应用程序可以请求的URI被下载到一个特定的目标文件。 The DownloadManager will conduct the download in the background, taking care of HTTP interactions and retrying downloads after failures or across connectivity changes and system reboots.该DownloadManager将进行后台下载,或通过连接到系统的变化和重新启动服务的HTTP交互和下载后重试失败。 Applications can obtain an instance of the DownloadManager class by calling getSystemService(String) and passing DOWNLOAD_SERVICE .应用程序可以获取的实例DownloadManager调用类的getSystemService(String)和传递DOWNLOAD_SERVICE 。 Applications that request downloads through this API should register a broadcast receiver for ACTION_NOTIFICATION_CLICKED , to appropriately handle when the user clicks on a running download in a notification or from the Downloads UI.这个API的应用程序应该注册请求下载一个接收器,通过广播ACTION_NOTIFICATION_CLICKED ,妥善处理用户界面,当用户下载或点击上运行下载的通知。 The DownloadManager.Request class lets an application provide all the information necessary to request a new download, such as request URI and download destination.该DownloadManager.Request类允许应用程序提供一切必要的信息来请求新的下载的目的地,例如请求URI和下载。 A request URI is the only required parameter.一个请求的URI是唯一需要的参数。 Note that the default download destination is a shared volume where the system can delete your file if it needs to reclaim space for system use.请注意,默认的下载目标是一个共享卷的地方,系统可以删除自己的文件,如果它需要回收系统使用空间。 For persistent storage of a download, specify a download destination on external storage (see setDestinationUri(Uri) ).对于下载持久存储,外部存储下载指定的目的地(见setDestinationUri(Uri) )。 The DownloadManager.Query class provides methods that let an application query for and filter active downloads.该DownloadManager.Query类提供的方法,让一个应用程序查询和筛选活动下载。 u StrictMode StrictMode To help developers monitor and improve the performance of their applications, the platform offers a new system facility called StrictMode .为了帮助开发人员监控,提高他们的应用程序的性能,该平台提供了一个新的系统设施称为StrictMode 。 When implemented in an application, StrictMode catches and notifies the developer of accidental disk or network activity that could degrade application performance, such as activity taking place on the applications main thread (where UI operations are received and animations are also taking place).当在应用程序中实现,StrictMode渔获物和通知意外磁盘或网络活动的开发者可能会降低应用程序的性能,如以在应用程序的主线程(UI的操作都在接收和动画也正在发生)举行的活动。 Developers can evaluate the network and disk usages issues raised in StrictMode and correct them if needed, keeping the main thread more responsive and preventing ANR dialogs from being shown to users.开发人员可以评估网络和磁盘的用法问题StrictMode提出和纠正他们,如果需要,保持主线程的响应,防止被显示给用户的ANR对话。 StrictMode is the core class and is the main integration point with the system and VM. StrictMode是核心类,是系统和虚拟机的主要结合点。 The class provides convenience methods for managing the thread and VM policies that apply to the instance.这个类提供了用于管理线程,适用于虚拟机实例的政策,便利的方法。 StrictMode.ThreadPolicy and StrictMode.VmPolicy hold the policies that you define and apply to thread and VM instances. StrictMode.ThreadPolicy和StrictMode.VmPolicy举行的政策定义,适用于线程和虚拟机实例。 For more information about how to use StrictMode to optimize your application, see the class documentation and sample code at android.os.StrictMode .欲了解更多的信息,有关如何使用StrictMode可以优化应用程序,类文档和示例代码中看到android.os.StrictMode 。 u UI Framework UI框架 Support for overscroll支持overscroll o New support for overscroll in Views and Widgets.新的支持overscroll视图和部件。 In Views, applications can enable/disable overscroll for a given view, set the overscoll mode, control the overscroll distance, and handle the results of overscrolling.在视图中,应用程序可以启用/禁用overscroll一个给定的视图,设置overscoll模式,控制overscroll距离,并处理overscrolling的结果。 o In Widgets, applications can control overscroll characteristics such as animation, springback, and overscroll distance.在Widget中,应用程序可以控制overscroll如动画,回弹特性,overscroll距离。 For more information, see android.view.View and android.widget.OverScroller .有关详细信息,请参阅android.view.View和android.widget.OverScroller 。 o ViewConfiguration also provides methods getScaledOverflingDistance() and getScaledOverscrollDistance() . ViewConfiguration还提供了一些方法getScaledOverflingDistance()和getScaledOverscrollDistance() o New overScrollMode , overScrollFooter , and overScrollHeader attributes for elements, for controlling overscroll behavior.新overScrollMode , overScrollFooter和overScrollHeader为属性元素,用于控制overscroll行为。 Support for touch filtering支持触控过滤 o New support for touch filtering, which lets an application improve the security of Views that provide access to sensitive functionality.新的支持触摸过滤,它可以让一个应用程序改善的意见,提供访问敏感功能的安全性。 For example, touch filtering is appropriate to ensure the security of user actions such as granting a permission request, making a purchase, or clicking on an advertisement.例如,触摸过滤适当,以确保如授予权限请求用户操作的安全性,进行购买,或在广告点击。 For details, see the View class documentation .有关详细信息,请参见视图类的文档 。 o New filterTouchesWhenObscured attribute for view elements, which declares whether to filter touches when the views window is obscured by another visible window.新filterTouchesWhenObscured属性视图中的元素,其中宣布是否触动过滤视图时的窗口是窗口遮蔽了另一个可见。 When set to true , the view will not receive touches whenever a toast, dialog or other window appears above the views window.当设置为true ,认为将不会收到涉及敬酒时,对话或其它窗口的窗口上方出现视图的。 Refer to View security documentation for details.请参阅安全文档查看详情。 To look at sample code for touch filtering, see SecureView.java in the ApiDemos sample application.看的代码样本见触摸过滤, SecureView.java在ApiDemos示例应用程序。 Improved event management改进的事件管理 o New base class for input events, InputEvent .新的事件,基类输入InputEvent 。 The class provides methods that let applications determine the meaning of the event, such as by querying for the InputDevice from which the event orginated.这个类提供的方法,让应用程序决定,如为从该事件orginated的InputDevice查询事件的意义。 The KeyEvent and MotionEvent are subclasses of InputEvent .该KeyEvent和MotionEvent是子类InputEvent 。 o New base class for input devices, InputDevice .新的输入设备基类, InputDevice 。 The class stores information about the capabilities of a particular input device and provides methods that let applications determine how to interpret events from an input device.类存储有关特定输入设备的功能和信息提供方法,让应用程序确定如何解释从输入设备事件。 Improved motion events改进的运动事件 o The MotionEvent API is extended to include pointer ID information, which lets applications to keep track of individual fingers as they move up and down.该MotionEvent API是扩大到包括“指针标识”的信息,这使应用程序保持手指追踪单个因为他们向上和向下移动。 The class adds a variety of methods that let an application work efficiently with motion events.这个类添加一个方法,让一个应用程序的工作效率与各种移动事件。 o The input system now has logic to generate motion events with the new pointer ID information, synthesizing identifiers as new pointers are down.输入系统现在的逻辑来生成新指针移动事件ID信息,综合识别新指针处于关闭状态。 The system tracks multiple pointer IDs separately during a motion event, and ensures proper continuity of pointers by evaluating at the distance between the last and next set of pointers.该系统跟踪多个单独的ID在一个指针移动事件,并确保通过在指针之间的距离最后和下一组适当的评价指标的连续性。 Text selection controls文本选择控制 o A new setComposingRegion method lets an application mark a region of text as composing text, maintaining the current styling.一个新的setComposingRegion方法允许应用程序标记造型地区撰写文字文本,维持电流。 A getSelectedText method returns the selected text to the application.阿getSelectedText方法返回应用程序中选择文本。 The methods are available in BaseInputConnection , InputConnection , and InputConnectionWrapper .该方法可在BaseInputConnection , InputConnection和InputConnectionWrapper 。 o New textSelectHandle , textSelectHandleLeft , textSelectHandleRight , and textSelectHandleWindowStyle attributes for , for referencing drawables that will be used to display text-selection anchors and the style for th

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论