当前位置:网站首页>Method of accessing mobile phone storage location permission under non root condition
Method of accessing mobile phone storage location permission under non root condition
2022-07-06 18:40:00 【Chenfuxu】
1.Manifest Apply for permission to read and write external files
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
2. The higher version requires dynamic permission application
int checkReadExternalPermission = checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE);
int checkWriteExternalPermission = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
if (checkReadExternalPermission != PackageManager.PERMISSION_GRANTED || checkWriteExternalPermission != PackageManager.PERMISSION_GRANTED) {
requestPermissions(new String[] {Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 0x01);
}
3. If an error is reported and the file cannot be accessed , stay application Add
android:requestLegacyExternalStorage="true"
4. Note that sometimes the file cannot be read or written successfully because the file memory is too large
边栏推荐
- Echart simple component packaging
- Test 1234
- Xu Xiang's wife Ying Ying responded to the "stock review": she wrote it!
- Mathematics in machine learning -- common probability distribution (XIII): Logistic Distribution
- Stm32+esp8266+mqtt protocol connects onenet IOT platform
- Distiller les connaissances du modèle interactif! L'Université de technologie de Chine & meituan propose Virt, qui a à la fois l'efficacité du modèle à deux tours et la performance du modèle interacti
- [Sun Yat sen University] information sharing of postgraduate entrance examination and re examination
- 测试1234
- Penetration test information collection - CDN bypass
- STM32+ENC28J60+UIP协议栈实现WEB服务器示例
猜你喜欢
Xu Xiang's wife Ying Ying responded to the "stock review": she wrote it!
Mathematics in machine learning -- common probability distribution (XIII): Logistic Distribution
视频化全链路智能上云?一文详解什么是阿里云视频云「智能媒体生产」
Recommend easy-to-use backstage management scaffolding, everyone open source
十、进程管理
Distill knowledge from the interaction model! China University of science and Technology & meituan proposed virt, which combines the efficiency of the two tower model and the performance of the intera
小程序在产业互联网中的作用
Grafana 9.0 正式发布!堪称最强!
ORACLE进阶(四)表连接讲解
Jerry is the custom background specified by the currently used dial enable [chapter]
随机推荐
Execution process of MySQL query request - underlying principle
Automatic reservation of air tickets in C language
Penetration test information collection - WAF identification
2022 Summer Project Training (III)
使用block实现两个页面之间的传统价值观
Tree-LSTM的一些理解以及DGL代码实现
Splay
SAP Fiori 应用索引大全工具和 SAP Fiori Tools 的使用介绍
Hongke shares | plate by plate ar application in Beijing Winter Olympics
关于npm install 报错问题 error 1
Recommend easy-to-use backstage management scaffolding, everyone open source
Specify flume introduction, installation and configuration
Jdbc driver, c3p0, druid and jdbctemplate dependent jar packages
Comparative examples of C language pointers *p++, * (p++), * ++p, * (++p), (*p) + +, +(*p)
[Sun Yat sen University] information sharing of postgraduate entrance examination and re examination
二叉搜索树
echart简单组件封装
Stm32+hc05 serial port Bluetooth design simple Bluetooth speaker
POJ 2208 已知边四面体六个长度,计算体积
监控界的最强王者,没有之一!