Android-Android6.0新特性-略讲1

下面介绍下Android6.0的新特性(略讲 以后会分章节讲)


1.Runtime Permissions(运行时检查和请求权限)

调用checkSelfPermission()检查是否有权限 requestPermissions()请求权限


2.Doze and App Standby(睡眠和APP的备份) 

这两个功能是为了节电用的 手机耗电快一直是诟病

Doze:官方说:If a user leaves a device unplugged and stationary for a period of time, with the screen off, the device enters Doze mode. 就是手机屏幕暗下来的 手机就进入了Doze模式


进入这个模式后Android系统会干些什么呢:

首先限制网络的连接 限制密集型的CPU操作

然后过一段时间又连接网络和做一些之前延迟的CPU操作 然后又进入Doze模式 如此循环来达到省电

官方文档的图:


就是睡一会有唤醒干一下活然后又睡了


然后会对我们的应用造成什么样的影响呢


1.我就不知道QQ即时通信应用可能会没有及时弹出qq信息

2.AlarmManager会影响到

具体看官网文档


App Standby:这个更好理解 就是如果有一个应用我很久没使用了 我就限制它的联网或者做其他操作(毕竟联网很耗电的) Android官方说可以让他们一天一次联网的说


3.Apache HTTP Client Removalns

卧槽 把Apache的httpClient去掉了 叫你用他开发的HttpURLConnection

官方的理由是:因为httpURLconnection有压缩有缓存 挺好的


如果你非要使用就用这个吧

android {
    useLibrary 'org.apache.http.legacy'
}


.4.BoringSSL

其实这个是什么鬼 没用过 摘取官方文档 有人知道的告诉我一声

Android is moving away from OpenSSL to the BoringSSL library. If you’re using the Android NDK in your app, don't link against cryptographic libraries that are not a part of the NDK API, such as libcrypto.soand libssl.so. These libraries are not public APIs, and may change or break without notice across releases and devices. In addition, you may expose yourself to security vulnerabilities. Instead, modify your native code to call the Java cryptography APIs via JNI or to statically link against a cryptography library of your choice.


其实这个是什么鬼 没用过 摘取官方文档 有人知道的告诉我一声


5.Access to Hardware Identifier(访问硬件标识符)

首先加入权限 ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION

可以访问比如WIFI蓝牙这些硬件的标识符 好吧暂时似乎对我没什么用


6.Notifications

去掉了方法Notification.setLatestEventInfo()

建议我们用 Notification.Builder  构建notification


还有下回分解

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值