編輯:高級開發
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
更多改進
目前android 2.3將支持更大的屏幕尺寸定義,開發者可以通過 <supports screens ... android:xlargeScreens="true">
元素在你的 manifest files 中定義,新增的 xlarge 標記將支持更多的屏幕尺寸
, 有關具體的使用方法,android開發網將在今後的文章中講到。.
glDrawElements()
和 glVertexAttribPointer()
方法在 android.opengl.GLES20
類中. YV12
pixel 格式和 4:2:0 YCrCb 格式的支持。 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. 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. ContactsContract
provider adds the ContactsContract.CommonDataKinds.SipAddress
data kind, for storing a contact's SIP (Internet telephony) address. 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.
LocationManager
adds several new methods that let an Activity register to receive periodic or one-time location updates based on specifIEd criteria (see below). 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. StorageManager
類支持 OBB (Opaque Binary Blob) 文件在 android 2.3上開發恐懼創建和管理OBB文件將在2011年早期無法使用。 isExternalStorageRemovable() 可以知道是否是一個物理的SD卡
. PackageInfo
新增 firstInstallTime
和 lastUpdateTime
可以查看一個軟件的安裝和上次更新時間,這比直接獲取APK路徑查看文件時間更可靠,對於付費的私有路徑未root的機型無權限獲取的。 getProviderInfo()
方法獲取content provider類相關信息. TelephonyManager
增加了對CDMA EVDO Rev B網絡類型的定義NETWORK_TYPE_EVDO_B
. getPsc()
返回私有混合碼從UMTS網絡. NativeActivity是一個新的
Activity類整個聲明周期的方法可以通過本地C/C++代碼直接訪問,使用android NDK r5或更高版本即可支持。
InputQueue
類提供本地管理事件隊列的回調接口 SurfaceHolder.Callback2 接口可以讓C/C++代碼管理
SurfaceHolder
. takeInputQueue
和 takeSurface()
讓本地代碼管理一個窗口事件. 有關最新版的NDK下載和NDK參考文檔可以在 android開發包下載 中找到。
有關Dalvik運行時庫
dalvik.system
移除了很多類,在上一版本這些類已經標記為將放棄使用包含以下 ArrayDeque
, NavigableMap
, ConcurrentSkipListMap
, LinkedBlockingDeque
數據類型 Arrays
輔助方法: binarySearch()
, copyOf()
, copyOfRange()
, and others. 新增CookIEManager
針對HttpURLConnection
. InterfaceAddress
, NetworkInterface
和 IDN
文件讀寫控制
String.isEmpty()
Normalizer
和 Normalizer.Form
Javax.Net.ssl
server sockets. 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). 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個或更多的點.
以上是android 2.3姜餅的API改變大全,有關具體的新增功能實用,Android123將在今後的文章和android進階開發系列教程中逐一介紹。
android手機運用的操作系統的核心系統服務依賴於 Linux 2.6 內核,如安全性,內存管理,進程管理,網絡協議棧和驅動模型,這些都由一個任務管理器來控制,既方便
曾經,我們暢想過android版本的Firefox在技術層面已經沒有障礙,而近日,Mozilla的CEO John Lilly和Mobile for Mozilla主席
android基本組件在日常生活中的應用還是很普遍的,但是要熟練的使用Android基本組件的前提是先要了解下什麼是Android基本組件?以及android基本組件的
繼PHP for android實現之後,微軟.Net for android,也就是MonoDroid,也將馬上進入Beta測試階段,最終的MonoDroid產品將在