Android 1.6 API变更概要: 1、UI framework · 新的类 android.view.animation 控制动画行为: o AnticipateInterpolator o AnticipateOvershootInterpolator o BounceInterpolator o OvershootInterpolator 2、· 新的XML 属性android:onClick ,从一个layout文件描述一个view的 View.OnClickListener. · 对不同分辨率的屏幕的新的支持. 对于Bitmap和Canvas会执行有针对性的缩放行为.该框架会根据屏幕分辨率和其他内容自动缩放bitmap等. 要在你的应用中使用Android 1.6包含的API的话你必须要设置 "4"属性在manifest的 元素中 3、Search framework · 应用程序现在可以公开的有关内容,作为建议放入快速搜索框,新的设备范围内的搜索功能,是可从主屏幕搜索。为了支持这一点,搜索框架增加了新的属性,可搜索的元数据文件。有关完整的信息,请参阅SearchManager文档。 4、Accessibility framework · New android.accessibility package that includes classes for capturing accessibility events and forwarding them to an AccessibilityService handler. · New AccessibilityService package that lets your application track user events and provide visual, audible, or haptic feedback to the user. 5、Gesture Input · 新的gesture API :创建,识别,读取,保存手势. 6、Text-to-speech · 新的android.speech.tts 包提供了TTS文本朗读功能,从一个文本生成一个声音文件的回放. 7、Graphics ·android.graphics 中的类,现在支持为不同的屏幕尺寸进行缩放. 8、Telephony · 新的SmsManager 发送和接受短信. 9、Utilities · 新的DisplayMetrics 字段决定当前设备屏幕的密度. 10、Android Manifest elements o 新的 元素 o 新的 标签 o glEsVersion: 指定最小openGL ES的版本 · 11、元素的新的属性: o 目标SDK版本: 应用程序能够指定目标版本. 它能够运行在旧版本(低至minSdkVersion), 他是按照应用程序的指定版本开发的. Specifying this version allows the platform to disable compatibility code that is not required or enable newer features that are not available to older applications. o maxSdkVersion: 指定设计这个程序运行的最高版本 重要: 当使用 这些属性前请认真阅读文档. 12、New Permissions · CHANGE_WIFI_MULTICAST_STATE: 允许应用进入Wi-Fi 多点传送模式. · GLOBAL_SEARCH: 允许全局搜索系统,以便精确确定 content provider. · INSTALL_LOCATION_PROVIDER: 允许应用在Location Manager.安装一个location provider. · READ_HISTORY_BOOKMARKS: 允许应用读取(并不能写) 用户的浏览记录和书签 · WRITE_HISTORY_BOOKMARKS: 允许应用写入 (并不能读) 用户的浏览记录和书签 · WRITE_EXTERNAL_STORAGE: 允许程序写入外部存储器.应用程序使用API级别3下将默认授予此权限 (这对用户可见的); 应用程序使用API level4 或者更高的,必须要明确的宣告此权限.
Android 2.0.1 API变更概要: · 新的快速联系人标记风格(quickContactBadgeStyle)* 属性,让应用的QuickContactBadge 组件接收必要的风格. · 当在manifest里面宣布了filter,取消了支持 ACTION_CONFIGURATION_CHANGED 广播 ,如果想要去接收这个广播, 这个应用必须注册 registerReceiver(BroadcastReceiver, IntentFilter). 性能上的改变: 1、Bluetooth 改变了 ACTION_REQUEST_ENABLE 和ACTION_REQUEST_DISCOVERABLE的返回值 · ACTION_REQUEST_ENABLE 如果蓝牙是成功开启的,现在返回RESULT_OK .如果使用者拒绝开启蓝牙的请求,则会返回RESULT_CANCELED . · ACTION_REQUEST_DISCOVERABLE 如果使用者拒绝启动蓝牙或者蓝牙的可发现功能,则返回 RESULT_CANCELED . 2、通讯 The ACTION_INSERT Intent returns RESULT_CANCELED in cases where the contact was not persisted (例如剪切保存到一个空的操作里面). 修复错误: 3、资源 现在framework可以正选择应用资源的根据API等级划分的文件夹(drawable-v4是API level4版本用的资源).现在的版本这个功能不能正常工作的问题已经修复. 4、Contacts The ACTION_INSERT Intent now returns the appropriate kind of URI when the request is made using the (now deprecated) Contacts APIs. 5、Other Framework fixes · getCallingPackage() 现在正确的报告包名, 而不是进程名.
Android 3.0 API变更概要: Android 3.0 SDK中新增了哪些API呢? 我们总结下平板系统honeycomb中的新特性, 首先需要澄清的是经过Android123发现设置模拟器的分辨率到普通WVGA这样的解析度时平板的特性自动消失和Android 2.3没有什么太大区别,按照这样来看未来Android 3.0除了兼容平板外还继续可以被手机所支持,据称3.0的代码针对A9双核CPU进行了进一步的改进。 一、Fragments 碎片容器 有关Android Fragments的内容,Android开发网在前几天已经用几篇文章详细讲解了下,大家可以从Fragment对比Activity - Android碎片介绍 一文开始了解。 二、Action Bar 活动栏 活动栏Action Bar可以替换传统的标题栏在Activity窗口中,包括程序图标和一些新接口在activity的选项菜单中,另外Action Bar允许你 Include select menu items directly in the Action Bar—as "action items"—for quick access to global user actions. In your XML declaration for the menu item, include the attribute, android:showAsAction with a value of "ifRoom". When there's enough room in the Action Bar, the menu item appears directly in the bar. Otherwise, the item is placed in the overflow menu, revealed by the icon on the right side of the Action Bar. Add interactive widgets to the Action Bar—as "action views"—such as a search box. In the XML for the menu item that should behave as an action view, include the android:actionViewLayout attribute with a layout resource for the action view or android:actionViewClass with the class name of the widget. Like action items, an action view appears only when there's room for it in the Action Bar. If there's not enough room, it is placed in the overflow menu and behaves like a regular menu item (for example, an item can provide a SearchView as an action view, but when in the overflow menu, selecting the item activates the search dialog). Add an action to the application logo when tapped and replace it with a custom logo The application logo is automatically assigned the android.R.id.home ID, which the system deliveres to your activity's onOptionsItemSelected() callback when tapped. Simply respond to this ID in your callback method to perform an action such as go to your application's "home" activity. To replace the icon with a logo, Add breadcrumbs for navigating backward through fragments Add built in tabs and a drop-down list for navigation Customize the Action Bar themes and custom backgrounds 有关ActionBar的文章,可以参考 Action Bar使用方法 - Android活动栏 系列文章 三、System clipboard系统剪切板 Android 3.0中的剪切板进行了增强,本次可以支持除了纯文本外更多的内容,如,URL和Intent,对于剪切板类ClipboardManager仍然通过 getSystemService(CLIPBOARD_SERVICE)来实例化,新增的ClipData类用于管理具体的复制对象,可以在SDK的 android.content.ClipData.Item中找到。具体的使用Android123将在今后的文章中写道。 四、拖拽 开始拖拽内容在你的Activity中可以使用startDrag()方法在一个View中,这里View.DragShadowBuilder提供了拖拽时的阴影,对于拖拽的过程处理可以通过OnDragListener通过View的setOnDragListener()来设置,在拖拽的时候系统会自动调用onDrag()方法。 五、增强的appWidgets Android 3.0的appWidget开始支持更丰富的控件,比如GridView, ListView, StackView, ViewFlipper和AdapterViewFlipper.而以前必须通过RemoteView显示一个文本或图片,本次全新的 RemoteViewsService增强了桌面小插件的功能。 六、增强的状态提示栏 新增的Notification API可以丰富你的状态栏,新的Notification.Builder类可以帮助你轻松实现,支持大图标提示信息通过setLargeIcon方法,通常显示一些社交类的软件,比如联系人照片,或相册缩略图,设置自定义状态栏,可以使用setTicker()方法。 七、内容加载器 新框架API提供了一个异步加载内容的泪,合并和UI组件和fragment来动态加载数据从工作者现成,使用CursorLoader子类来获取ContentResolver中的数据. 八、A2DP蓝牙和耳机控制API Android honeycomb中没有忘记再次增强蓝牙,你可以通过初始化BluetoothProfile通过调用getProfileProxy()在处理 A2DP或耳机HEADSET设置,BluetoothProfile.ServiceListener可以获取客户端连接或断开的回调。 九、动画框架 3.0中Android再次增强动画播放类,ObjectAnimator和LayoutTransition需要大家了解一些。 十、扩展UI框架 新增以下UI控件 AdapterViewAnimator AdapterViewFlipper CalendarView ListPopupWindow NumberPicker PopupMenu SearchView StackView 十一、图形相关 1. 2D图形硬件加速Hardware accelerated 2D graphics , 在androidmanifest.xml的元素中添加android:hardwareAccelerated="true" 即可。他可以优化程序运行更平滑高效,在滚动和动画方面。 2.设置渲染模式,比如 LAYER_TYPE_HARDWARE 硬件加速和 LAYER_TYPE_SOFTWARE 使用 setLayerType() 方法. 3.渲染脚本对于3D图形方面大家可以看看Renderscript类。