Android 6.0 Marshmallow 的改变

来源:互联网 发布:中国工商银行mac版 编辑:程序博客网 时间:2024/06/07 16:04

Android 6.0 Marshmallow 的改变

从官网翻译的

Android 6.0

1.Runtime Permissions

其实就是很多权限,需要调用requestPermissions() 获取权限,然后可视化给用户,权限使用更透明。

详细解释

2.Doze And App standby

两种省电延长使用的功能。
设备没有连接到电源,设备进入 Doze 模式时,系统将通过延迟最近用户没有使用的应用程序的后台 CPU 运作及网络活动,让应用程序处于 App Standby 状态,以此来减少电池消耗。谷歌表示,在 Nexus5 和 Nexus6 上测试,当屏幕处于关闭状态,平均续航时间提高 30%。

3.Apache HTTP Client Removal

Apache HTTP Client 被移除
为了继续使用Apache HTTP APIs,应该在build.gradle中添加

android {
useLibrary ‘org.apache.http.legacy’
}

4.BoringSSL

Android is moving away from OpenSSL to the BoringSSL library.

5.Access to Hardware Identifier

Android 23为了更好的保护用户数据。Android不再提供App直接调用
WifiInfo.getMacAddress() and BluetoothAdapter.getAddress()来获取Wifi或者蓝牙信息
而是要先有
ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permissions权限。

6.Notifications

移除掉了Notification.setLatestEventInfo() ,使用Notificaiton.Builder来构建notifications。

7.AudioManager Changes

AudioManager 不再直接支持设置声音。
setStreamSolo()和setStreamMute()已经被requestAudioFocus()和adjustStreamVolume()代替。

8.Text Selection

用户选择字体之后,会有个悬浮工具栏,包括,copy , cut , paste.还可以改变方向。
需要继承 floating toolbar。

9.Android Keystore Changes

Android Keystore provider 不再支持DSA,ECDSA仍然支持。

10.Wi-Fi and Networking Changes

1.你现在可以改变已经创建的WifiConfiguration的状态,也可以删除和更改其他APP的WifiConfiguraiton 实例。
2.通过设置连接专有网络,而不再连接其他网络。

11.Camera Service Changes

通过不同的优先权来代替先来先服务的请求,优先权高的可以获得服务,而被“驱逐”的就会调用OnError()函数或者onDisConnected()函数.

0 0
原创粉丝点击