GithubHelp home page GithubHelp logo

dozip's Introduction

Dozip

Android WebView 本地更新-ZIP文件下载,解压,加载等。

/**
 * 下载
 */
private void doDownLoadWork() {
    DownLoaderTask task = new DownLoaderTask("http://www.html5code.net/uploads/soft/160407/1-16040H21141.zip",
            PATH, this, mZipOverListener);
    //DownLoaderTask task = new DownLoaderTask("http://192.168.9.155/johnny/test.h264", getCacheDir().getAbsolutePath()+"/", this);
    task.execute();
} 
/**
 * 将资源文件打包到Assets中,第一次加载时 拷贝到SD
 * @param strOutFileName
 */
private void copyBigDataToSD(String strOutFileName) {
    InputStream myInput = null;
    OutputStream myOutput = null;
    try {
        myOutput = new FileOutputStream(strOutFileName);
        myInput = this.getAssets().open("1-16040H21141.zip");
        byte[] buffer = new byte[1024];
        int length = myInput.read(buffer);
        while (length > 0) {
            myOutput.write(buffer, 0, length);
            length = myInput.read(buffer);
        }
        myOutput.flush();
        myInput.close();
        myOutput.close();
    } catch (IOException e) {
    } finally {
        ZipExtractorTask task = new ZipExtractorTask(PATH + "/" + "1-16040H21141.zip", PATH, MainActivity.this, true,
                null);
        task.execute();
    }
}

dozip's People

Contributors

yingtongwang avatar

Watchers

James Cloos avatar Louis L avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.