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會執(zhí)行有針對性的縮放行為.該框架會根據(jù)屏幕分辨率和其他內(nèi)容自動縮放bitmap等. 要在你的應(yīng)用中使用Android 1.6包含的API的話你必須要設(shè)置 "4"屬性在manifest的 元素中 3、Search framework · 應(yīng)用程序現(xiàn)在可以公開的有關(guān)內(nèi)容,作為建議放入快速搜索框,新的設(shè)備范圍內(nèi)的搜索功能,是可從主屏幕搜索。為了支持這一點(diǎn),搜索框架增加了新的屬性,可搜索的元數(shù)據(jù)文件。有關(guān)完整的信息,請參閱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 :創(chuàng)建,識別,讀取,保存手勢. 6、Text-to-speech · 新的android.speech.tts 包提供了TTS文本朗讀功能,從一個文本生成一個聲音文件的回放. 7、Graphics ·android.graphics 中的類,現(xiàn)在支持為不同的屏幕尺寸進(jìn)行縮放. 8、Telephony · 新的SmsManager 發(fā)送和接受短信. 9、Utilities · 新的DisplayMetrics 字段決定當(dāng)前設(shè)備屏幕的密度. 10、Android Manifest elements o 新的 元素 o 新的 標(biāo)簽 o glEsVersion: 指定最小openGL ES的版本 · 11、元素的新的屬性: o 目標(biāo)SDK版本: 應(yīng)用程序能夠指定目標(biāo)版本. 它能夠運(yùn)行在舊版本(低至minSdkVersion), 他是按照應(yīng)用程序的指定版本開發(fā)的. 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: 指定設(shè)計(jì)這個程序運(yùn)行的最高版本 重要: 當(dāng)使用 這些屬性前請認(rèn)真閱讀文檔. 12、New Permissions · CHANGE_WIFI_MULTICAST_STATE: 允許應(yīng)用進(jìn)入Wi-Fi 多點(diǎn)傳送模式. · GLOBAL_SEARCH: 允許全局搜索系統(tǒng),以便精確確定 content provider. · INSTALL_LOCATION_PROVIDER: 允許應(yīng)用在Location Manager.安裝一個location provider. · READ_HISTORY_BOOKMARKS: 允許應(yīng)用讀取(并不能寫) 用戶的瀏覽記錄和書簽 · WRITE_HISTORY_BOOKMARKS: 允許應(yīng)用寫入 (并不能讀) 用戶的瀏覽記錄和書簽 · WRITE_EXTERNAL_STORAGE: 允許程序?qū)懭胪獠看鎯ζ?應(yīng)用程序使用API級別3下將默認(rèn)授予此權(quán)限 (這對用戶可見的); 應(yīng)用程序使用API level4 或者更高的,必須要明確的宣告此權(quán)限.
Android 2.0.1 API變更概要: · 新的快速聯(lián)系人標(biāo)記風(fēng)格(quickContactBadgeStyle)* 屬性,讓應(yīng)用的QuickContactBadge 組件接收必要的風(fēng)格. · 當(dāng)在manifest里面宣布了filter,取消了支持 ACTION_CONFIGURATION_CHANGED 廣播 ,如果想要去接收這個廣播, 這個應(yīng)用必須注冊 registerReceiver(BroadcastReceiver, IntentFilter). 性能上的改變: 1、Bluetooth 改變了 ACTION_REQUEST_ENABLE 和ACTION_REQUEST_DISCOVERABLE的返回值 · ACTION_REQUEST_ENABLE 如果藍(lán)牙是成功開啟的,現(xiàn)在返回RESULT_OK .如果使用者拒絕開啟藍(lán)牙的請求,則會返回RESULT_CANCELED . · ACTION_REQUEST_DISCOVERABLE 如果使用者拒絕啟動藍(lán)牙或者藍(lán)牙的可發(fā)現(xiàn)功能,則返回 RESULT_CANCELED . 2、通訊 The ACTION_INSERT Intent returns RESULT_CANCELED in cases where the contact was not persisted (例如剪切保存到一個空的操作里面). 修復(fù)錯誤: 3、資源 現(xiàn)在framework可以正選擇應(yīng)用資源的根據(jù)API等級劃分的文件夾(drawable-v4是API level4版本用的資源).現(xiàn)在的版本這個功能不能正常工作的問題已經(jīng)修復(fù). 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() 現(xiàn)在正確的報告包名, 而不是進(jìn)程名.
Android 3.0 API變更概要: Android 3.0 SDK中新增了哪些API呢? 我們總結(jié)下平板系統(tǒng)honeycomb中的新特性, 首先需要澄清的是經(jīng)過Android123發(fā)現(xiàn)設(shè)置模擬器的分辨率到普通WVGA這樣的解析度時平板的特性自動消失和Android 2.3沒有什么太大區(qū)別,按照這樣來看未來Android 3.0除了兼容平板外還繼續(xù)可以被手機(jī)所支持,據(jù)稱3.0的代碼針對A9雙核CPU進(jìn)行了進(jìn)一步的改進(jìn)。 一、Fragments 碎片容器 有關(guān)Android Fragments的內(nèi)容,Android開發(fā)網(wǎng)在前幾天已經(jīng)用幾篇文章詳細(xì)講解了下,大家可以從Fragment對比Activity - Android碎片介紹 一文開始了解。 二、Action Bar 活動欄 活動欄Action Bar可以替換傳統(tǒng)的標(biāo)題欄在Activity窗口中,包括程序圖標(biāo)和一些新接口在activity的選項(xiàng)菜單中,另外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 有關(guān)ActionBar的文章,可以參考 Action Bar使用方法 - Android活動欄 系列文章 三、System clipboard系統(tǒng)剪切板 Android 3.0中的剪切板進(jìn)行了增強(qiáng),本次可以支持除了純文本外更多的內(nèi)容,如,URL和Intent,對于剪切板類ClipboardManager仍然通過 getSystemService(CLIPBOARD_SERVICE)來實(shí)例化,新增的ClipData類用于管理具體的復(fù)制對象,可以在SDK的 android.content.ClipData.Item中找到。具體的使用Android123將在今后的文章中寫道。 四、拖拽 開始拖拽內(nèi)容在你的Activity中可以使用startDrag()方法在一個View中,這里View.DragShadowBuilder提供了拖拽時的陰影,對于拖拽的過程處理可以通過OnDragListener通過View的setOnDragListener()來設(shè)置,在拖拽的時候系統(tǒng)會自動調(diào)用onDrag()方法。 五、增強(qiáng)的appWidgets Android 3.0的appWidget開始支持更豐富的控件,比如GridView, ListView, StackView, ViewFlipper和AdapterViewFlipper.而以前必須通過RemoteView顯示一個文本或圖片,本次全新的 RemoteViewsService增強(qiáng)了桌面小插件的功能。 六、增強(qiáng)的狀態(tài)提示欄 新增的Notification API可以豐富你的狀態(tài)欄,新的Notification.Builder類可以幫助你輕松實(shí)現(xiàn),支持大圖標(biāo)提示信息通過setLargeIcon方法,通常顯示一些社交類的軟件,比如聯(lián)系人照片,或相冊縮略圖,設(shè)置自定義狀態(tài)欄,可以使用setTicker()方法。 七、內(nèi)容加載器 新框架API提供了一個異步加載內(nèi)容的淚,合并和UI組件和fragment來動態(tài)加載數(shù)據(jù)從工作者現(xiàn)成,使用CursorLoader子類來獲取ContentResolver中的數(shù)據(jù). 八、A2DP藍(lán)牙和耳機(jī)控制API Android honeycomb中沒有忘記再次增強(qiáng)藍(lán)牙,你可以通過初始化BluetoothProfile通過調(diào)用getProfileProxy()在處理 A2DP或耳機(jī)HEADSET設(shè)置,BluetoothProfile.ServiceListener可以獲取客戶端連接或斷開的回調(diào)。 九、動畫框架 3.0中Android再次增強(qiáng)動畫播放類,ObjectAnimator和LayoutTransition需要大家了解一些。 十、擴(kuò)展UI框架 新增以下UI控件 AdapterViewAnimator AdapterViewFlipper CalendarView ListPopupWindow NumberPicker PopupMenu SearchView StackView 十一、圖形相關(guān) 1. 2D圖形硬件加速Hardware accelerated 2D graphics , 在androidmanifest.xml的元素中添加android:hardwareAccelerated="true" 即可。他可以優(yōu)化程序運(yùn)行更平滑高效,在滾動和動畫方面。 2.設(shè)置渲染模式,比如 LAYER_TYPE_HARDWARE 硬件加速和 LAYER_TYPE_SOFTWARE 使用 setLayerType() 方法. 3.渲染腳本對于3D圖形方面大家可以看看Renderscript類。