Here you can find the source of unzip(final String zipFile, String outPath)
public static void unzip(final String zipFile, String outPath)
//package com.java2s; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import android.util.Log; public class Main { public static void unzip(final String zipFile, String outPath) { if (!outPath.endsWith(File.separator)) { outPath = outPath + File.separator; }//www . ja v a 2s . co m try { final FileInputStream fin = new FileInputStream(zipFile); final ZipInputStream zis = new ZipInputStream(fin); ZipEntry entry = null; while ((entry = zis.getNextEntry()) != null) { Log.v("Decompress", "Unzipping " + entry.getName()); if (entry.isDirectory()) { final File f = new File(outPath, entry.getName()); if (!f.exists()) { f.mkdirs(); } } else { int size; final byte[] buffer = new byte[2048]; final File f = new File(outPath, entry.getName()); final FileOutputStream fos = new FileOutputStream(f); final BufferedOutputStream bos = new BufferedOutputStream( fos, buffer.length); while ((size = zis.read(buffer, 0, buffer.length)) != -1) { bos.write(buffer, 0, size); } bos.flush(); bos.close(); } } zis.close(); fin.close(); } catch (final Exception e) { Log.e("Decompress", "unzip", e); } } }