Skip to content

Commit

Permalink
feat(android): compression level
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ga committed Sep 17, 2022
1 parent fde2abe commit f83898c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ See example for more details.
## zip Parameter
Android:
* filename:String, files:Array, options: Object [compression: Compression.BEST_SPEED| Compression.DEFAULT_COMPRESSION | Compression.NO_COMPRESSION]
* filename:String, files:Array, options: Object [compression: Compression.BEST_SPEED | Compression.DEFAULT_COMPRESSION | Compression.NO_COMPRESSION]
iOS:
* filename:String, files:Array
Expand All @@ -85,10 +85,6 @@ dd if=/dev/urandom of=file1 bs=5M count=1
Clint Tredway
## Feedback and Support
Please direct all questions, feedback, and concerns to [[email protected]](mailto:[email protected]?subject=iOS%20Compression%20Module).
## License
Copyright(c) 2010-present by Axway Appcelerator. All Rights Reserved. Please see the LICENSE file included in the distribution for further details.
19 changes: 9 additions & 10 deletions example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ var zipFiles2 = Ti.UI.createButton({
zipFiles.addEventListener('click', function() {
var startTime = new Date();
var writeToZip = outputDirectory + '/zipFiles.zip';
var file = Ti.Filesystem.getFile(writeToZip);
if (file.exists()) {
file.deleteFile();
}
var file = Ti.Filesystem.getFile(writeToZip);
if (file.exists()) {
file.deleteFile();
}
var result = Compression.zip(writeToZip, [
inputDirectory + 'a.txt',
inputDirectory + 'b.txt',
Expand Down Expand Up @@ -69,10 +69,10 @@ zipFiles.addEventListener('click', function() {
zipFiles2.addEventListener('click', function() {
var writeToZip = outputDirectory + '/zipFiles.zip';

var file = Ti.Filesystem.getFile(writeToZip);
if (file.exists()) {
file.deleteFile();
}
var file = Ti.Filesystem.getFile(writeToZip);
if (file.exists()) {
file.deleteFile();
}
var startTime = new Date();
var result = Compression.zip(writeToZip, [
inputDirectory + 'a.txt',
Expand All @@ -88,8 +88,7 @@ zipFiles2.addEventListener('click', function() {
inputDirectory + 'icon2.png',
inputDirectory + 'icon3.png'
], {
compression: Compression.BEST_SPEED,
optimizeStorage: true
compression: Compression.BEST_SPEED
});
Ti.API.info(status.text = 'Zip Files: ' + result + ', to: ' + writeToZip);

Expand Down

0 comments on commit f83898c

Please sign in to comment.