如何以编程方式移动,复制和删除文件和目录的SD?方式、文件、目录、SD

2023-09-11 20:29:35 作者:你如妖精般勾去我的魂╰’

我想以编程方式移动,复制和删除在SD卡上的文件和目录。我已经做了谷歌搜索,但没有找到什么有用的东西。

I want to programmatically move, copy and delete files and directories on SD card. I've done a Google search but couldn't find anything useful.

推荐答案

使用标准的Java I / O 。使用 Environment.getExternalStorageDirectory()来获得的外部存储(其中,在某些设备,是一个SD卡)的根目录下。

Use standard Java I/O. Use Environment.getExternalStorageDirectory() to get to the root of external storage (which, on some devices, is an SD card).