Android how to use Environment.getExternalStorageDirectory()
问题 How can i use Environment.getExternalStorageDirectory() to read a a stored image from the SD card or is there a better way to do it? 回答1: Environment.getExternalStorageDirectory().getAbsolutePath() Gives you the full path the SDCard. You can then do normal File I/O operations using standard Java. Here's a simple example for writing a file: String baseDir = Environment.getExternalStorageDirectory().getAbsolutePath(); String fileName = "myFile.txt"; // Not sure if the / is on the path or not