我正在尝试从 URL 读取文件并写入我的 SD 卡。因为它适用于其他文件,如 .js .css 和 .txt 文件等...但它不适用于 .png .jpg .bmp 和 .gif。我的代码是
String path = dir + value;
File localConfigfile = new File(
Environment.getExternalStorageDirectory()
+ "/Avalon/assets/www/" + path);
String responseString = RequestMgr.GetWebSource(DomainName
+ "/" + Heirarchy + "/" + Serverpath);
FileOutputStream out;
if (localConfigfile.exists()) {
localConfigfile.delete();
out = new FileOutputStream(localConfigfile);
out.write(responseString.getBytes());
}
}
请帮助我,我对此感到震惊
最佳答案
尝试使用位图读取文件。如果您阅读使用位图和 URI 提高性能,这将是一个不错的选择
关于java - 在 ANDroid 中读取和写入图像到 SDCard,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24197618/