title: Extracting Zip File Not Working for me in android?
body: <p>I want to download zip file from server and extract in sdcard programmatically but it will not extracting zip file.</p>
  
  <p>I have check this tutorial</p>
  
  <p><a href="http://www.jondev.net/articles/Unzipping_Files_with_Android_%28Programmatically%29" rel="nofollow">http://www.jondev.net/articles/Unzipping_Files_with_Android_%28Programmatically%29</a></p>
  
  <p>I have use below code but it is not work for me </p>
  
  <pre><code>UnZipActivity.java
  
  public class UnZipActivity extends Activity {
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          UnZip un = new UnZip("/storage/emulated/0/peakmedia/news.zip","/storage/emulated/0/peakmedia/");
          un.unzip();
      }
  }
  </code></pre>
  
  <blockquote>
    <p>UnZip.java</p>
  </blockquote>
  
  <pre><code>public class UnZip {
  
      public String _zipFile; 
      public String _location; 
  
      public UnZip(String zipFile, String location) {
        _zipFile = zipFile; 
        _location = location; 
      } 
  
      public void unzip() { 
  
        try  { 
          FileInputStream fin = new FileInputStream(_zipFile); 
          ZipInputStream zin = new ZipInputStream(fin); 
          ZipEntry ze = null; 
          while ((ze = zin.getNextEntry()) != null) { 
            Log.v("Decompress", "Unzipping " + ze.getName()); 
            if(ze.isDirectory()) { 
              _dirChecker(ze.getName()); 
            } else { 
              FileOutputStream fout = new FileOutputStream(_location + ze.getName()); 
              for (int c = zin.read(); c != -1; c = zin.read()) { 
                fout.write(c); 
              } 
              zin.closeEntry(); 
              fout.close(); 
            } 
  
          } 
          zin.close(); 
        } catch(Exception e) { 
          Log.e("Decompress", "unzip", e); 
        } 
  
      } 
  
      private void _dirChecker(String dir) { 
        File f = new File(_location + dir); 
  
        if(!f.isDirectory()) { 
          f.mkdirs(); 
        } 
      } 
  
  }
  </code></pre>
  
  <blockquote>
    <p>Logcat Error :</p>
  </blockquote>
  
  <pre><code>02-03 15:23:09.125: E/Decompress(4936): unzip
  02-03 15:23:09.125: E/Decompress(4936): java.io.FileNotFoundException: /storage/emulated/0/peakmedia/news/jquery.backstretch.min.js: open failed: ENOENT (No such file or directory)
  02-03 15:23:09.125: E/Decompress(4936):     at libcore.io.IoBridge.open(IoBridge.java:416)
  02-03 15:23:09.125: E/Decompress(4936):     at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:88)
  02-03 15:23:09.125: E/Decompress(4936):     at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:128)
  02-03 15:23:09.125: E/Decompress(4936):     at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:117)
  02-03 15:23:09.125: E/Decompress(4936):     at com.peak.media.UnZip.unzip(UnZip.java:49)
  02-03 15:23:09.125: E/Decompress(4936):     at com.peak.media.UnZipActivity.onCreate(UnZipActivity.java:14)
  02-03 15:23:09.125: E/Decompress(4936):     at android.app.Activity.performCreate(Activity.java:5326)
  02-03 15:23:09.125: E/Decompress(4936):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
  02-03 15:23:09.125: E/Decompress(4936):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2225)
  02-03 15:23:09.125: E/Decompress(4936):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2316)
  02-03 15:23:09.125: E/Decompress(4936):     at android.app.ActivityThread.access$700(ActivityThread.java:158)
  02-03 15:23:09.125: E/Decompress(4936):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1296)
  02-03 15:23:09.125: E/Decompress(4936):     at android.os.Handler.dispatchMessage(Handler.java:99)
  02-03 15:23:09.125: E/Decompress(4936):     at android.os.Looper.loop(Looper.java:176)
  02-03 15:23:09.125: E/Decompress(4936):     at android.app.ActivityThread.main(ActivityThread.java:5365)
  02-03 15:23:09.125: E/Decompress(4936):     at java.lang.reflect.Method.invokeNative(Native Method)
  02-03 15:23:09.125: E/Decompress(4936):     at java.lang.reflect.Method.invoke(Method.java:511)
  02-03 15:23:09.125: E/Decompress(4936):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
  02-03 15:23:09.125: E/Decompress(4936):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
  02-03 15:23:09.125: E/Decompress(4936):     at dalvik.system.NativeStart.main(Native Method)
  02-03 15:23:09.125: E/Decompress(4936): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
  02-03 15:23:09.125: E/Decompress(4936):     at libcore.io.Posix.open(Native Method)
  02-03 15:23:09.125: E/Decompress(4936):     at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
  02-03 15:23:09.125: E/Decompress(4936):     at libcore.io.IoBridge.open(IoBridge.java:400)
  02-03 15:23:09.125: E/Decompress(4936):     ... 19 more
  </code></pre>