简体   繁体   中英

How to access the external storage?

I am creating an Android app. I use

String path = Environment.getExternalStorageDirectory().getPath();

to get the external storage path and create a new file in it. It seems my code can run. But I cannot find the new file it creates. Could you please tell me how can I find the file by computer? Like what is the path of the external storage? Thank you!

请使用DDMS,使用文件资源管理器,然后在/ mnt / sdcard /文件夹中查找

On most devices this will return /mnt/sdcard or /mnt/sdcard-ext. This will be the root of the disk if you mount the sdcard via USB. If you use adb to pull the files you would use the full /mnt/sdcard/... path.

The strange thing about your question is that you have the value in a string in your code. Generally people would just inspect the string or log its value to the console.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM