forked from phonegap/phonegap-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
37 lines (28 loc) · 1.12 KB
/
Copy pathREADME
File metadata and controls
37 lines (28 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
ExtractZipFile Phonegap Plugin for Android
=======================================
This plugin allows you to eatract a zip file located in your sdcard.
Adding the Plugin to your project
=================================
To install the plugin, copy ZipPlugin.js to your project's www folder and include a reference to it in your html files.
<script type="text/javascript" src="ZipPlugin.js"></script>
Create a folder called 'com/phonegap/plugin/ExtractZipFile' within your project's src folder and copy ExtractZipFilePlugin.java file into that new folder.
Add a plugin line to res/xml/plugins.xml
<plugin name="ZipPlugin" value="com.phonegap.plugin.ExtractZipFile.ExtractZipFilePlugin" />
Using the plugin
================
function extractFile(fileName)
{
var ZipClient = new ExtractZipFilePlugin();
ZipClient.extractFile('sdcard/'+fileName,win,fail,'ExtractZipFilePlugin');
}
function win(status)
{
alert('Success'+status);
}
function fail(error)
{
alert(error);
}
Function Call
=============
<input type="button" value="Extract Zip File" onClick="extractFile('ZipFolder/ZipFile.zip');"/>