目录
读写权限
文件读写,需要在application节点增加android:requestLegacyExternalStorage="true"
属性
...
<application
android:requestLegacyExternalStorage="true"
... >
</application>
...
否则报错:/storage/emulated/0/xxx/xxx open failed: EACCES (Permission denied)
网络权限
网络访问,需要在application节点增加
android:networkSecurityConfig="@xml/network_config"
属性
...
<application
android:networkSecurityConfig="@xml/network_config"
... >
</application>
...
文件存储
Environment.getExternalStoragePublicDirectory目录失效,用户在此目录保存文件会失败报异常。只能使用Context对象的getExternalFilesDir方法
https://blog.csdn.net/xiayiye5/article/details/113344204
- 分区存储机制
https://juejin.cn/post/6844904160752566279
如果没有适配,当运行至android10及以上的设备时访问/sdcard就会报错:Transport endpoint is not connected
,不管是shell还是什么app内访问。
AppcomatAcitivity
- You need to use a Theme.AppCompat theme
https://blog.csdn.net/generallizhong/article/details/92978943
0 条评论