当前位置:网站首页>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
边栏推荐
猜你喜欢
AvL树的实现
None of the strongest kings in the monitoring industry!
十、进程管理
Docker installation redis
Alibaba cloud international ECS cannot log in to the pagoda panel console
Virtual machine VirtualBox and vagrant installation
30 minutes to understand PCA principal component analysis
根据PPG估算血压利用频谱谱-时间深度神经网络【翻】
UDP protocol: simple because of good nature, it is inevitable to encounter "city can play"
Maixll-Dock 摄像头使用
随机推荐
node の SQLite
ORACLE进阶(四)表连接讲解
Top command details
Interpreting cloud native technology
基于ppg和fft神经网络的光学血压估计【翻译】
Automatic reservation of air tickets in C language
Cobra quick start - designed for command line programs
2022/02/12
There is a sound prompt when inserting a USB flash disk under win10 system, but the drive letter is not displayed
Jushan database was among the first batch of financial information innovation solutions!
CSRF vulnerability analysis
Transport layer congestion control - slow start and congestion avoidance, fast retransmission, fast recovery
Introduction to the use of SAP Fiori application index tool and SAP Fiori tools
Crawling data encounters single point login problem
Atcoder a mountaineer
30 minutes to understand PCA principal component analysis
44 colleges and universities were selected! Publicity of distributed intelligent computing project list
Example of implementing web server with stm32+enc28j60+uip protocol stack
Xu Xiang's wife Ying Ying responded to the "stock review": she wrote it!
287. Find duplicates