Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> Android開發 >> 高級開發 >> Android 0.9 API改變中文總結

Android 0.9 API改變中文總結

編輯:高級開發

最新的android 0.9 SDK和m5-rc15相比API有什麼改變呢? 下面我們一起來看看,有關詳細的Package以及API的添加、刪除、修改如下:

一、移除了下面的Package

android.awt
android.telephony.gsm.stk
android.test.mock
com.google.android.gtalkservice
Java.lang.instrument
Javax.sound.midi
Javax.sound.midi.spi
Javax.sound.sampled
Javax.sound.sampled.spi
org.apache.http.clIEnt.methods.multipart
org.apache.http.impl (移動到內部實現)
org.apache.http.impl.auth (移動到內部實現)
org.apache.http.impl.clIEnt (移動到內部實現)
org.apache.http.impl.conn (移動到內部實現)
org.apache.http.impl.conn.tsccm (移動到內部實現)
org.apache.http.impl.cookIE (移動到內部實現)
org.apache.http.impl.entity (移動到內部實現)
org.apache.http.impl.io (移動到內部實現)
org.apache.http.util.concurrent
org.bluez

我們看到主要是一些J2ME時代的音樂播放類,還有apache相關的部分方法移到內部來實現了,不過藍牙支持在0.9版android SDK中存在些問題

二、增加的Package

android.content.res
android.Net.wifi
android.preference
android.test
android.test.suitebuilder.annotation
dalvik.annotation
dalvik.bytecode
dalvik.system
Java.awt.font
Javax.microedition.khronos.egl
Javax.XML
org.apache.http.clIEnt.entity
org.apache.http.conn.routing
org.apache.http.conn.scheme

新增了一些實用的功能比如Wifi無線網絡、http相關的操作、加入了AWT字體包。

三、修改的Package有下面

android
android.app
android.content
android.content.pm
android.database
android.database.sqlite
android.graphics
android.graphics.drawable
android.graphics.drawable.shapes
android.hardware
android.location
android.media
android.Net
android.opengl
android.os
android.provider
android.telephony
android.telephony.gsm
android.text
android.text.method
android.text.style
android.text.util
android.util
android.vIEw
android.vIEw.animation
android.webkit
android.widget
com.google.android.maps
Java.io
Java.lang.ref
Java.lang.reflect
Java.Net
Java.util
Java.util.concurrent
Java.util.jar
Java.util.logging
Java.util.regex
Javax.Net.ssl
Javax.XML.parsers
org.apache.http
org.apache.http.auth
org.apache.http.auth.params
org.apache.http.clIEnt
org.apache.http.clIEnt.methods
org.apache.http.clIEnt.params
org.apache.http.clIEnt.protocol
org.apache.http.clIEnt.utils
org.apache.http.conn
org.apache.http.conn.params
org.apache.http.conn.ssl
org.apache.http.conn.util
org.apache.http.cookIE
org.apache.http.cookIE.params
org.apache.http.entity
org.apache.http.message
org.apache.http.params
org.apache.http.protocol
org.apache.http.util

修改了數據庫SQLite、圖形接口、正則表達式、以及HTTP文件相關的如SSL、XML解析

詳細的改變有

Activity (活動窗口類)

  • onFreeze(Bundle) 改名為onSaveInstanceState(Bundle)
  • onFreeze() 改名為onSaveInstanceState()
  • onThaw(Parcelable) 改名為 onRestoreInstanceState(Parcelable)
  • onCompleteThaw(Bundle) 改名為 onRestoreInstanceState(Bundle)
  • Preferred Activity: 這個將自動選擇賦予Activity組件 (Preferred Activity) 擋 Context.startActivity() 找到多個匹配的Activites時將通過intent filter. 這個 package管理器提供API設置管理preferred ActivitIEs.
  • setResult()方法采用一個新的字符串參數已經被新的setResult()方法作為一個Intent參數替代。

Adapters (適配器)

  • FilterQueryProvider從SimpleCursorAdapter提升到CursorAdapter
  • 移除getMeasurementVIEw() 從Adapter
  • 重命名Adapter.stableIds()成Adapter.hasStableIds()
  • 在ArrayAdapter中addObject(), removeObject() 和insertObject()重命名為add(), remove() and insert()
  • 使用SimpleAdapter更簡單輕松,Binding現在能控制被客戶端傳遞一個SimpleAdapter.VIEwBinder到SimpleAdapter
  • 重命名CursorAdapter的runQuery()方法為runQueryOnBackgroundThread

Android Manifest (android清單文件)

  • 一個新的manageSpaceActivity屬性讓你指明activity啟動一個管理空間在用戶請求時.這個系統啟動時指明
  • setprop debug.separate_processes - This will apply to every process in every package.
  • setprop debug.separate_processes "com.google.process.content,com.google.android.samples" - This will impact only the code whose manifest involves one of the given processes (here com.google.process.content com.google.android.samples) -- either as the manifest package name, or listed as an explicit android:process tag. Note that using this option will either split a process into parts (corresponding to the packages inside of it)or combine multiple processes into one (if they come from the same package). That is, it forces all impacted components to run in the process for their own .apk, regardless of what android:process attributes specify.
  • The AlertDialog was changed/extended to allow the custom view to be used in addition to the list vIEw.
  • Added support for application aliases., where you can create a .apk that contains no code, only an activity definition for a system-supplIEd "AliasActivity," which looks at meta-data in your manifest to determine which actual Intent to start.
  • Notifications can have default pattern for sound, vibrate, and/or lights. Notifications also have a flag to automatically cancel the notification when selected.
  • A new WallpaperService which will be responsible for setting and getting the wallpaper. The wallpaper will be stored in settings.
  • Two new methods let you check the desired height and width of wallpaper
  • The package android.accounts adds helper classes and interfaces that let your app receive notifications of changes in the active Google account(s)

Browser/WebVIEw

  • The browser itself no longer downloads content that it can not render. When content is discovered that it can't render, the DownloadListener.onDownloadStart() method is called with the details of the content. It is up to the client application of WebVIEw to handle this situation.
  • When a WebView requests a new window to be created via WebChromeClient.shouldCreateWindow() a flag is now passed to indicate if the window should be treated as a dialog (IE, the window has no Chrome of it's own)
  • WebViews now support plugins. The location of the plugin is set via WebVIEw.setPluginsPath(). Plugins are native (C/C++) code that implement the NPAPI interface.

Google Maps

  • New Maps menu alphabetic shortcuts This adds four invisible menu items:
      menu+I - zoom in
      menu+O - zoom out
      menu+J - previous result
      menu+K - next result
  • Add a new style attribute to enable/disable MapVIEw's My Location feature. By default it's disable meaning no extra location based permissions are required for developers wanting to write a Maps based app.
  • Move Overlay.PixelCalculator -> MapView.PixelCalculator and added a MapVIEw.getPixelCalculator.
  • A new GestureDetector to help detect common gestures.
  • The OverlayController, MyLocationOverlay and MapController classes are changed to final
  1. 上一頁:
  2. 下一頁: