`
zhifeiji512
  • 浏览: 115582 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Android 2.3 API改变大全

阅读更多

Android 2.3的API Level为9,有关所有的API改变,Android123帮助大家总结如下:

  新增包

android.media.audiofx    混响音效
android.net.sip     VOIP支持
android.nfc      NFC支付支持
android.os.storage  存储管理类

详细的请查看 Android 2.3新特性及改进列表,已正式发布 一文

移除类

VMDebug    
VMRuntime    
VMStack    
Zygote  

更多改进

Extra Large Screens
  目前Android 2.3将支持更大的屏幕尺寸定义,开发者可以通过 <supports screens ... android:xlargeScreens="true"> 元素在你的 manifest files 中定义,新增的 xlarge 标记将支持更多的屏幕尺寸, 有关具体的使用方法,Android开发网将在今后的文章中讲到。.

Graphics
添加保留了OpenGL ES 2.0 中的 glDrawElements() 和 glVertexAttribPointer() 方法在 android.opengl.GLES20 类中. 
新增YV12 pixel 格式和 4:2:0 YCrCb 格式的支持。 
Content Providers
New AlarmClock provider class for setting an alarm or handling an alarm. The provider contains a ACTION_SET_ALARM Intent action and extras that can be used to start an Activity to set a new alarm in an alarm clock application. Applications that wish to receive the SET_ALARM Intent should create an activity that requires the the SET_ALARM permission. Applications that wish to create a new alarm should use Context.startActivity(), so that the user has the option of choosing which alarm clock application to use. 
MediaStore supports a new Intent action, PLAY_FROM_SEARCH, that lets an application search for music media and automatically play content from the result when possible. For example, an application could fire this Intent as the result of a voice recognition command to listen to music. 
MediaStore also adds a new MEDIA_IGNORE_FILENAME flag that tells the media scanner to ignore media in the containing directory and its subdirectories. Developers can use this to avoid having graphics appear in the Gallery and likewise prevent application sounds and music from showing up in the Music app. 
The Settings provider adds the new Activity actions APPLICATION_DETAILS_SETTINGS and MANAGE_ALL_APPLICATIONS_SETTINGS, which let an application show the details screen for a specific application or show the Manage Applications screen. 
The ContactsContract provider adds the ContactsContract.CommonDataKinds.SipAddress data kind, for storing a contact's SIP (Internet telephony) address. 
Location
LocationManager 类可以跟踪程序请求wake locks 或 wifi locks 的结果通过 to WorkSource 类,让系统管理指定的程序. 
The LocationManager keeps track of all clients requesting periodic updates, and tells its providers about them as a WorkSource parameter, when setting their minimum update times. The network location provider uses WorkSource to track the wake and wifi locks initiated by an application and adds it to the application's battery usage reported in Manage Applications. 

The LocationManager adds several new methods that let an Activity register to receive periodic or one-time location updates based on specified criteria (see below). 
A new Criteria class lets an application specify a set of criteria for selecting a location provider. For example, providers may be ordered according to accuracy, power usage, ability to report altitude, speed, and bearing, and monetary cost. 
Storage
Android 2.3 新增 StorageManager 类支持 OBB (Opaque Binary Blob) 文件在 Android 2.3上开发恐惧创建和管理OBB文件将在2011年早期无法使用。 
加入一些判断虚拟SD分区,Android123提示大家,类似三星i9000可能存在虚拟的SD路径,所以 isExternalStorageRemovable() 可以知道是否是一个物理的SD卡. 
Package Manager
PackageInfo 新增 firstInstallTime 和 lastUpdateTime 可以查看一个软件的安装和上次更新时间,这比直接获取APK路径查看文件时间更可靠,对于付费的私有路径未root的机型无权限获取的。 
新增 getProviderInfo() 方法获取content provider类相关信息. 
Telephony
TelephonyManager 增加了对CDMA EVDO Rev B网络类型的定义NETWORK_TYPE_EVDO_B. 
新的 getPsc() 返回私有混合码从UMTS网络. 
Android 2.3 可以让应用本地访问声明周期和窗口
  NativeActivity是一个新的Activity类整个声明周期的方法可以通过本地C/C++代码直接访问,使用Android NDK r5或更高版本即可支持。 

新增 InputQueue 类提供本地管理事件队列的回调接口 
新增 SurfaceHolder.Callback2 接口可以让C/C++代码管理 SurfaceHolder. 
新增 takeInputQueue 和 takeSurface() 让本地代码管理一个窗口事件. 
有关最新版的NDK下载和NDK参考文档可以在 Android开发包下载 中找到。

有关Dalvik运行时库

dalvik.system  移除了很多类,在上一版本这些类已经标记为将放弃使用包含以下 
Dalvik 核心库: 
新增 collections: ArrayDeque, NavigableMap, ConcurrentSkipListMap, LinkedBlockingDeque 数据类型 
新增 Arrays 辅助方法: binarySearch(), copyOf(), copyOfRange(), and others. 
新增CookieManager针对HttpURLConnection. 
更完整的网络API支持比如 InterfaceAddress, NetworkInterface 和 IDN 
文件读写控制 
String.isEmpty() 
Normalizer 和 Normalizer.Form 
改进了 javax.net.ssl server sockets. 
新增manifest元素和属性
新增 xlargeScreens 属性针对 <supports-screens> 元素,可以支持更大设备比如说Android平板的定义。 
新的屏幕方向属性 android:screenOrientation 在<activity> 中 
"reverseLandscape" — The Activity would like to have the screen in landscape orientation, turned in the opposite direction from normal landscape. 
"reversePortait" — The Activity would like to have the screen in portrait orientation, turned in the opposite direction from normal portrait. 
"sensorLandscape" — The Activity would like to have the screen in landscape orientation, but can use the sensor to change which direction the screen is facing. 
"sensorPortrait" — The Activity would like to have the screen in portrait orientation, but can use the sensor to change which direction the screen is facing. 
"fullSensor" — Orientation is determined by a physical orientation sensor: the display will rotate based on how the user moves the device. This allows any of the 4 possible rotations, regardless of what the device will normally do (for example some devices won't normally use 180 degree rotation). 
新增 Permissions
com.android.permission.SET_ALARM —设置一个提醒权限. 
android.permission.USE_SIP — 使用SIP接收一个VOIP. 
android.permission.NFC — 允许程序使用NFC支持 
有关硬件的改进如下

android.hardware.audio.low_latency — 允许使用 low-latency 音频管道在设备和可以提供敏感的延迟在声音输出输出上。 
android.hardware.camera.front — 前置摄像头控制类. 
android.hardware.nfc —  NFC近距无线设备管理. 
android.hardware.sensor.barometer — 气压计感应器支持类The application uses the device's barometer. 
android.hardware.sensor.gyroscope —  陀螺仪感应器支持类 The application uses the device's gyroscope sensor. 
android.software.sip — SIP VoIP类. 
android.software.sip.voip — 使用基于 SIP的 VoIP 服务. 
android.hardware.touchscreen.multitouch.jazzhand — 增强的多点触控类,可以实现跟踪5个或更多的点. 









 

分享到:
评论

相关推荐

    Google Android SDK开发范例大全(PDF完整版4)(4-4)

    Google Android SDK开发范例大全(完整版)共4个分卷 目录 第1章 了解.深入.动手做. 1.1 红透半边天的Android 1.2 本书目的及涵盖范例范围 1.3 如何阅读本书 1.4 使用本书范例 1.5 参考网站 第2章 Android初体验 2.1...

    Google Android SDK开发范例大全(PDF高清完整版1)(4-1)

    Google Android SDK开发范例大全(完整版)共4个分卷 目录 第1章 了解.深入.动手做. 1.1 红透半边天的Android 1.2 本书目的及涵盖范例范围 1.3 如何阅读本书 1.4 使用本书范例 1.5 参考网站 第2章 Android初体验 2.1...

    Google Android SDK开发范例大全的目录

    2.3 Android应用程序架构——从此开始 2.4 可视化的界面开发工具 2.5 部署应用程序到Android手机 第3章 用户人机界面 3.1 更改与显示文字标签——TextView标签的使用 3.2 更改手机窗口画面底色——drawable定义颜色...

    Google Android SDK开发范例大全(完整版附部分源码).pdf

    Google Android SDK开发范例大全(完整版) 包含部分书中源码 目录 第1章 了解.深入.动手做. 1.1 红透半边天的Android 1.2 本书目的及涵盖范例范围 1.3 如何阅读本书 1.4 使用本书范例 1.5 参考网站 第2章 ...

    BaiduMapApi_Lib_Android_1.3.5

    百度地图forAndroid :1.35 jar版本,主要是能帮助之前android2.3以下的老百度地图应用能升级到android4.2以上使用,而不需要改动代码(因为目前最新百度地图androidAPI已经做了很大改变)

    Google Android SDK开发范例大全(PDF高清完整版3)(4-3)

    Google Android SDK开发范例大全(完整版)共4个分卷 目录 第1章 了解.深入.动手做. 1.1 红透半边天的Android 1.2 本书目的及涵盖范例范围 1.3 如何阅读本书 1.4 使用本书范例 1.5 参考网站 第2章 Android初体验 2.1...

    Google Android SDK 开发范例大全01

    Google Android SDK开发范例大全 目录 第1章 了解.深入.动手做. 1.1 红透半边天的Android 1.2 本书目的及涵盖范例范围 1.3 如何阅读本书 1.4 使用本书范例 1.5 参考网站 第2章 Android初体验 2.1 安装AndroidSDK与...

    Google Android SDK 开发范例大全02

    Google Android SDK开发范例大全 目录 第1章 了解.深入.动手做. 1.1 红透半边天的Android 1.2 本书目的及涵盖范例范围 1.3 如何阅读本书 1.4 使用本书范例 1.5 参考网站 第2章 Android初体验 2.1 安装AndroidSDK与...

    Android高级编程--源代码

    2.3 To-Do List示例 35 2.4 Android开发工具 40 2.4.1 Android模拟器 41 2.4.2 Dalvik调试监控服务(DDMS) 41 2.4.3 Android调试桥(ADB) 41 2.5 小结 42 第3章 创建应用程序和活动 43 3.1 Android应用程序的...

    《Android高级编程》

    2.2 面向移动设备的开发 2.2.1 关于硬件设计的考虑事项 2.2.2 考虑用户环境 2.2.3 Android开发 2.3 To-Do List示例 2.4 Android开发工具 2.4.1 Android模拟器 2.4.2 Dalvik调试监控服务(DDMS) 2.4.3 Android调试桥...

    Google Android sdk 开发范例大全 部分章节代码

    Google Android SDK开发范例大全 目录 第1章 了解.深入.动手做. 1.1 红透半边天的Android 1.2 本书目的及涵盖范例范围 1.3 如何阅读本书 1.4 使用本书范例 1.5 参考网站 第2章 Android初体验 2.1 安装AndroidSDK与...

    Google Android SDK开发范例大全(完整版)

    2.3 Android应用程序架构——从此开始 2.4 可视化的界面开发工具 2.5 部署应用程序到Android手机 第3章 用户人机界面 3.1 更改与显示文字标签——TextView标签的使用 3.2 更改手机窗口画面底色——drawable定义颜色...

    2010年谢彦的android笔记

    1.6 编译在N1上运行的android 2.3(GingerBread)代码 18 1.7 系统结构 21 1.8 模拟器调试与真机调试 22 1.9 安装和卸载应用程序(apk包) 23 1.10 系统升级 26 1.11 android系统支持app2sd(修改boot.img) 27 2 基本...

    Android高级编程.pdf

    2.3 To-Do List示例 2.4 Android开发工具 2.4.1 Android模拟器 2.4.2 Dalvik调试监控服务(DDMS) 2.4.3 Android调试桥(ADB) 2.5 小结 第3章 创建应用程序和活动 3.1 Android应用程序的组成部分 3.2 程序清单简介 ...

    疯狂Android讲义源码

     2.3 基本界面组件 60  2.3.1 文本框(TextView)与编辑框  (EditText)的功能和用法 60  2.3.2 按钮(Button)与图片按钮(ImageButton)组件的功能和  用法 66  2.3.3 使用9Patch图片作为按钮背景 68  ...

    Android 4游戏编程入门经典

     2.3 运行和调试android应用程序  2.3.1 连接设备  2.3.2 创建一个android虚拟设备  2.3.3 运行应用程序  2.3.4 调试应用程序  2.3.5 logcat和ddms  2.3.6 使用adb  2.4 小结 第3章 游戏开发基础  3.1 游戏...

Global site tag (gtag.js) - Google Analytics