Giter VIP home page Giter VIP logo

cordova-plugin-zipper's Introduction

Cordova Zipper Plugin

一个zip压缩与解压插件。

如何使用

  1. 创建一个cordova工程

    cordova create cordova-test-app 
    cd cordova-test-app
  2. 安装插件

    通过git仓库方式安装

    cordova plugin add git+https://github.com/alvisisme/cordova-plugin-zipper.git

    通过本地文件方式安装

    git clone https://github.com/alvisisme/cordova-plugin-zipper.git
    cordova plugin add ./cordova-plugin-zipper
  3. 接口测试

    编辑 www/js/index.js 文件,在 onDeviceReady 函数内加入如下语句并保存文件。

    var success = function(message) {
        alert(message);
    }
    
    var failure = function() {
        alert("Error calling Zipper Plugin");
    }
    
    cordova.plugins.zipper.compress({
        zipfile: '/sdcard/compress.zip',
        file: '/sdcard/templates.json'
    }
  4. 安装支持平台

    cordova platform add android
  5. 构建应用

    cordova build
  6. 运行应用

    cordova run

API接口

执行npm run doc,见 out/index.html

常见问题

  • libc++_shared.so多次安装问题

    当多个插件同时存在libc++_shared.so时会存在冲突导致安装失败,一般可以在插件安装时加入--force选项强制安装。

    而 cordova-plugin-zipper 插件安装前会通过钩子函数自动判断是否存在 libc++_shared.so,不存在则复制到对应目录,

    卸载时则需要根据工程依赖自己决定是否删除 libc++_shared.so,无法自动删除。

参考引用

cordova-plugin-zipper's People

Contributors

alvisisme avatar

Stargazers

 avatar

Watchers

 avatar  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.