守望者--AIR技术交流
标题: Zip管理器ANE [打印本页]
作者: 破晓 时间: 2014-12-29 22:09
标题: Zip管理器ANE
Zip Manager ANE V2.0 (Android+iOS)What’s new in V2.0
1) rebuilt the whole thing to add support for iOS
2) supports Android-ARM, Android-x86, iPhone-ARM
3) processes the zip works on threads natively both on Android and iOS
4) depricated the download zip methods. we have a separated powerful DownloadManager class for this job: DM
5) added methods to cancel zipping or unzipping progresses
ZipManager class will zip or unzip big, big zip archives super fast as it is 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 
manifest setup
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
- <extensions>
- <extensionID>com.doitflash.air.extensions.zipManager</extensionID>
- </extensions>
复制代码 Usage
- import com.doitflash.air.extensions.zip.ZipManager;
- import com.doitflash.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]");
- }
复制代码 在线API
http://myappsnippet.com/DOC/com/doitflash/air/extensions/zip/package-detail.html
DEMO下载:
http://myappsnippet.com/downloads/AIR_EXTENSIONS/zipManager/zipManager_AIR.zip
相关链接:
http://myappsnippet.com/zip-manager-adobe-air-extension/
http://bbs.9ria.com/thread-427231-1-1.html
| 欢迎光临 守望者--AIR技术交流 (http://www.airmyth.com/) |
|