我很高興宣佈 Spring for Android 2.0.0.M2 現在可以在 Spring 的里程碑版本庫中使用。重點包括:
- 透過 HttpComponentsClientHttpRequestFactory 支援 Android 版本的 HttpClient 4.3
- 現在不建議使用 Android 內建的 HttpClient 4.0,但仍可透過 HttpComponentsAndroidClientHttpRequestFactory 使用。
- RestTemplate 中的 HTTP PATCH 支援
- Spring Core 的類型轉換套件現在可以在 Spring for Android Core 中使用。
- Spring 3.2 的許多改進和修復現已合併到 Spring for Android 中,以使基準相容性達到 Spring 3.2,同時已包含 Spring 4.1 的某些 RestTemplate 功能以支援新的 HttpClient。
- 其他錯誤修復和改進
HttpClient 4.3
如果 HttpClient 4.3 for Android 在類別路徑中可用,它將被配置為預設的 HTTP 客戶端。 在您的 build.gradle
中包含以下依賴項以利用新的 HttpClient。
dependencies {
compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
}
最低版本
最低支援版本是 Android 2.2(API 等級 8),但是它現在佔 Android 開發人員 儀表板上 Android 裝置的 0.5%。 我們建議 Android 2.3 作為新應用程式的最低目標,因為像 Jackson 2.4 和 OkHttp 這樣的第三方函式庫需要 Android 2.3 及更高版本。
結論
有關變更的完整列表,請參閱 JIRA 中的發佈說明。 參考文件也已更新以涵蓋新功能。
再次感謝所有為此版本做出貢獻的人! 請嘗試這個新的里程碑版本,並在 JIRA 或 GitHub 上報告任何問題。