Распаковка файлов на андроиде кажется ужасно медленной. Сначала я думал, что это только эмулятор, но, похоже, он по телефону. Я пробовал разные уровни сжатия и, в конечном счете, опустился до режима хранения, но он все равно занимает много времени.
Во всяком случае, должна быть причина! Кто-нибудь еще сталкивался с этой проблемой? Мой метод распаковки выглядит следующим образом:
public void unzip()
{
try{
FileInputStream fin = new FileInputStream(zipFile);
ZipInputStream zin = new ZipInputStream(fin);
File rootfolder = new File(directory);
rootfolder.mkdirs();
ZipEntry ze = null;
while ((ze = zin.getNextEntry())!=null){
if(ze.isDirectory()){
dirChecker(ze.getName());
}
else{
FileOutputStream fout = new FileOutputStream(directory+ze.getName());
for(int c = zin.read();c!=-1;c=zin.read()){
fout.write(c);
}
//Debug.out("Closing streams");
zin.closeEntry();
fout.close();
}
}
zin.close();
}
catch(Exception e){
//Debug.out("Error trying to unzip file " + zipFile);
}
}