Tôi kinda mới để lập trình android và java, có thể ai đó cho tôi biết làm thế nào để lưu các tập tin, tôi có các mã sau:Làm thế nào để lưu tập tin vào thẻ sd
InputStream is = new FileInputStream(location + "/zipSample.zip");
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(is));
try {
ZipEntry ze;
while ((ze = zis.getNextEntry()) != null) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int count;
while ((count = zis.read(buffer)) != -1) {
baos.write(buffer, 0, count);
}
String filename = ze.getName();
byte[] bytes = baos.toByteArray();
// Do something with 'filename' and 'bytes' ...
// How do I save to sdcard?
}
} finally {
zis.close();
}
Cảm ơn rất nhiều sự giúp đỡ nào .
thể trùng lặp của [Viết một tập tin vào sdcard] (http://stackoverflow.com/questions/2455102/writing-a-file-to-sdcard) – jww