Android13适配记录

多语言支持,此功能在国内被阉割

配置后在设置内可以选择

复制代码
<?xml version="1.0" encoding="utf-8"?>
<locale-config xmlns:android="http://schemas.android.com/apk/res/android">
    <locale android:name="zh" />
    <locale android:name="en" />
    <locale android:name="tw" />
    <locale android:name="ar" />
    <locale android:name="de" />
    <locale android:name="es" />
    <locale android:name="fa" />
    <locale android:name="fr" />
    <locale android:name="it" />
    <locale android:name="ja" />
    <locale android:name="ko" />
    <locale android:name="ms" />
    <locale android:name="pl" />
    <locale android:name="pt" />
    <locale android:name="ru" />
    <locale android:name="sk" />
    <locale android:name="th" />
    <locale android:name="tr" />
    <locale android:name="vi" />
</locale-config>

拆分sd卡权限

把原来的storage权限拆分成image、audio、video三个权限。如果仅仅是操作图片,视频、语音没有操作文件类的,可以使用Android内置的图片选择器。

复制代码
			String p;
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
                p = Manifest.permission.READ_MEDIA_IMAGES;
            } else {
                p = Manifest.permission.READ_EXTERNAL_STORAGE;
            }

声明广告ID

如果接入了Google广告,需要声明广告ID权限

复制代码
<uses-permission android:name="com.google.android.gms.permission.AD_ID" />

webview 废弃API

复制代码
//  废弃      webSettings.setAppCachePath(appCachePath);
  替代      webSettings.setDatabasePath(appCachePath);
  
//  废弃      webSettings.setAppCacheEnabled(true);
//        setAppCacheEnabled(false) 可以用setCacheMode(WebSettings.LOAD_NO_CACHE)替代。
//        setAppCacheEnabled(true) 可以用setCacheMode(WebSettings.LOAD_DEFAULT)替代      
相关推荐
summerkissyou19876 小时前
Android - 摄像头 - hal - 开发教程,例子,常见问题,分析方法,解决方案
android
summerkissyou19877 小时前
Android 16 架构图
android
神龙天舞20017 小时前
MySQL 备库为什么会延迟好几个小时
android·数据库·mysql
码农coding10 小时前
android12 systemUI 之锁屏
android
圆山猫11 小时前
[Virtualization](三):RISC-V H-extension 与 Guest 执行模式
android·java·risc-v
爱笑鱼11 小时前
Binder(七):getCallingUid() 读到的是谁?clearCallingIdentity() 又清掉了什么?
android
2501_9159090617 小时前
iOS 应用反调试技详解术 检测调试器的原理与防护实践
android·ios·小程序·https·uni-app·iphone·webview
Lvan的前端笔记17 小时前
AndroidX 完全入门指南
android·androidx
帅次17 小时前
Android 应用高级面试:Window 近1年高频追问 18 题
android·面试·职场和发展
总捣什么乱118 小时前
MySQL MySQL是怎么保证主备一致的?
android·mysql·adb