Coder Social home page Coder Social logo

vaginessa / zipmanager-ane Goto Github PK

View Code? Open in Web Editor NEW

This project forked from myflashlab/zipmanager-ane

0.0 2.0 0.0 22.65 MB

ZipManager air native extension will zip or unzip large zip archives super fast using native process in threads supporting both Android and iOS

Batchfile 3.44% ActionScript 93.55% AngelScript 3.01%

zipmanager-ane's Introduction

Zip Manager ANE V3.0.1 (Android+iOS)

ZipManager class will zip or unzip large zip archives super fast using native process in threads supporting both Android and iOS. you will have listeners to watch the process progress. you have the option to cancel a zip or unzip progress. it's job is to concentrate on zip archiving and it does it in the best possible way!

in AS3, there are many different zip libraries which will do the same thing but they are not good enough when it comes to mobile usage because of the following reasons:

– They load the whole zip into runtime and then try to zip/unzip reading bytes which is too time consuming – loading a big zip file using AS3 libraries will fail on mobile devices because it takes too much RAM – AS workers are not yet supported on iOS and your Air UI will freez untill the process is finished! – the bottom line is that AS3 libs for handling zip files are TOO slow and not practical

using this extension will solve all the above problems. you will be amazed how fast it works no matter the size of the zip file. we tested with a ~1GB zip archive and it worked just fine :)

asdoc

find the latest asdoc for this ANE here.

Demo .apk

you may like to see the ANE in action? Download demo .apk

NOTICE: the demo ANE works only after you hit the "OK" button in the dialog which opens. in your tests make sure that you are NOT calling other ANE methods prior to hitting the "OK" button. Download the ANE

Air Usage

For the complete AS3 code usage, see the demo project here.

import com.myflashlab.air.extensions.zip.ZipManager;
import com.myflashlab.air.extensions.zip.ZipManagerEvent;

var _ex:ZipManager = new ZipManager();
_ex.addEventListener(ZipManagerEvent.START, onStart);
_ex.addEventListener(ZipManagerEvent.ERROR, onError);
_ex.addEventListener(ZipManagerEvent.PROGRESS, onProgress);
_ex.addEventListener(ZipManagerEvent.COMPLETED, onComplete);

_ex.unzip(File.documentsDirectory.resolvePath("TheZipFile.zip"), File.documentsDirectory.resolvePath("unzipLocation"));

function onStart(e:ZipManagerEvent):void
{
   trace("zip process started...");
}

function onError(e:ZipManagerEvent):void
{
   trace("zip process ERROR: " + e.param.msg);
}

function onProgress(e:ZipManagerEvent):void
{
   trace("zip Progress = " + e.param.perc + "%");
}

function onComplete(e:ZipManagerEvent):void
{
   trace("[zip process finished]");
}

AIR .xml manifest

<!--
FOR ANDROID:
-->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>





<!--
Embedding the ANE:
-->
  <extensions>
	<extensionID>com.myflashlab.air.extensions.zipManager</extensionID>
	
	<!-- Required if you are targeting AIR 24+ and have to take care of Permissions mannually -->
	<extensionID>com.myflashlab.air.extensions.permissionCheck</extensionID>
	
	<!-- download the dependency ANEs from https://github.com/myflashlab/common-dependencies-ANE -->
	<extensionID>com.myflashlab.air.extensions.dependency.androidSupport</extensionID>
	<extensionID>com.myflashlab.air.extensions.dependency.overrideAir</extensionID>
  </extensions>

Requirements

  • This ANE is dependent on androidSupport.ane and overrideAir.ane. Download them from here.
  • Android SDK 15 or higher
  • iOS 8.0 or higher

Permissions

If you are targeting AIR 24 or higher, you need to take care of the permissions mannually. Below are the list of Permissions this ANE might require. (Note: Necessary Permissions are those that the ANE will NOT work without them and Optional Permissions are those which are needed only if you are using some specific features in the ANE.)

Check out the demo project available at this repository to see how we have used our PermissionCheck ANE to ask for the permissions.

Necessary Permissions:
none

Optional Permissions:
2. PermissionCheck.SOURCE_STORAGE

Commercial Version

http://www.myflashlabs.com/product/zip-ane-adobe-air-native-extension/

Zip Manager ANE

Tutorials

How to embed ANEs into FlashBuilder, FlashCC and FlashDevelop

Changelog

Mar 31, 2017 - V3.0.1

  • Updated the ANE with the latest version of overrideAir. Even if you are building for iOS only, you will need this dependency.
  • Min iOS version to support this ANE is 8.0 from now on.
  • Min Android version to support this ANE is 15 from now on.

Nov 08, 2016 - V3.0.0

  • Optimized for Android manual permissions if you are targeting AIR SDK 24+
  • From now on, this ANE will depend on androidSupport.ane and overrideAir.ane on the Android side

Jan 20, 2016 - V2.9.2

Dec 20, 2015 - V2.9.1

  • minor bug fixes

Nov 03, 2015 - V2.9

  • doitflash devs merged into MyFLashLab Team

May 16, 2015 - V2.2

  • removed android-support-v4 dependency

Jan 27, 2015 - V2.1

  • added support for iOS 64-bit

Nov 07, 2014 - V2.0

  • rebuilt the whole thing to add support for iOS
  • supports Android-ARM, Android-x86, iPhone-ARM
  • processes the zip works on threads natively both on Android and iOS
  • depricated the download zip methods. we have a separated powerful DownloadManager class for this job: http://myappsnippet.com/download-manager-air-native-extension/
  • added methods to cancel zipping or unzipping progresses

Jul 06, 2013 - V1.0

  • beginning of the journey!

zipmanager-ane's People

Contributors

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