In the raw folder, of our android project, have a file to decompress. The control class is the controller of my application.

import android.os.Environment;

import com.plasmik.test.Control;
import com.plasmik.test.R;

public void testRaw()
 // output
 File sdcard = Environment.getExternalStorageDirectory();
 String subfolderSd = sdcard.getAbsolutePath() + "/" + Control.getPrefs().folderProject;
 File outputDir = new File (subfolderSd);

 // zip
 File f = new File(subfolderSd+"/");
 android.content.res.Resources t = Control.getContext().getResources();
 InputStream fis = t.openRawResource(R.raw.test);
 Utils.inputstreamToFile(fis, f);

 ZipHelper.unzip(f, outputDir);
 catch (Exception e) {
 Log.d("control","unzip error: "+e);

Seguir leyendo