Android5.0和Android6.0适配,
分享于 点击 30150 次 点评:38
Android5.0和Android6.0适配,
gradle配置项
targetSdkVersion | < | 平台的API级别 | 向前兼容举个栗子:targetSdkVersion==23(6.0),当前设备Android版本7.0,运行程序时用6.0那一套接口。接口:API接口 |
---|---|---|---|
targetSdkVersion | = | 平台的API级别 | 不启用兼容性 |
targetSdkVersion | > | 平台的API级别 | 举个栗子:targetSdkVersion==23(6.0),当前设备Android版本是 5.0 ,运行程序 用的是5.0那套接口。设备根本到不了6.0 |
是不是意味着targetSdkVersion越低越好?
minSdkVersion <= targetSdkVersion <= compileSdkVersion
andorid 5.0 新特性
android 5.0适配
解决方案
解决方案
解决方案(https://www.jianshu.com/p/0972a0d290e9)
Android5.0上 WebView中Http和Https混合问题
解决方案
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
}
WebView cookie 存储问题
public static void syncCookie(String url, String key) {
CookieManager cookieManager = CookieManager.getInstance();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
cookieManager.removeSessionCookies(null);
cookieManager.flush();
} else {
cookieManager.removeSessionCookie();
CookieSyncManager.getInstance().sync();
}
cookieManager.setAcceptCookie(true);
cookieManager.setCookie(url, key);
}
JobScheduler和JobService是安卓在api 21中增加的接口(保活),功能更强的闹钟
Android 6.0 适配及新特性
取消支持 Apache HTTP
解决方案:
android {
useLibrary 'org.apache.http.legacy'
}
BoringSSL
请勿链接到并非 NDK API 组成部分的加密库,如 libcrypto.so 和 libssl.so
在原有的电源管理的基础上加入了两种新的状态:
指纹识别(统一API)
相关文章
- 暂无相关文章
用户点评