我的Android应用程序需要读取复制到设备根目录的CSV文件(设备没有根目录,所以我猜这不是真正的根目录,只是您看到的目录在Windows资源管理器中打开设备)。从Android上的根文件夹读取文件
我想知道这是否可能?
当我这样做:
File file = new File("/data.csv");
if (file.exists()) {
System.out.println("File exists!");
} else {
System.out.println("File does NOT exist");
}
我得到:“文件不存在”
检查此:http://stackoverflow.com/a/5858161/1404734 –
http://developer.android.com/reference/android/os/Environment.html – Raghunandan