I'm working on an AIR application for IOS that uses a SWC that my company created. The AIR application is the shell for browsing books, and the SWC is responsible for downloading the book and displaying it. While a book is downloading, we present a nice loading animation - a sparkly book turning pages. We are disappointed with the performance of the animation - it stutters badly as the files are being unzipped.
We started out using FZip as our library for decompressing our download zip files. It's really nice, as it extracts the files from the zip as it downloads, and never saves the zip file to disk. The problem with FZip is that it's reading the zip FileStream bit by bit, looking for file descriptors so it knows what to decompress. While it's doing this, it gets stuck in a while... loop that doesn't allow anything to animate until it finds the descriptor it's searching for. This is the cause of our stuttering.
I tried another AIR based zip library called Airxzip. This one works beautifully on most files - the animation plays smoothly all the way through the download with only minor stuttering after the file is downloaded to disk and it starts unzipping the files. The problem with this one is that when we try to download zip files over 50MB our app crashes on the iPad Mini - a low memory environment.
I found an ANE called ANEZipFile that I thought might manage memory better as it gets downloaded and decompressed with native IOS code. The problem now is that because my books are downloaded and displayed by a SWC, the SWC won't allow me to include the ANE. I tried creating an instance of a ZipFile object in the main AIR application, and it works okay there. Then I tried to pass a reference to that object into the SWC, and it didn't work. It fails on init, where the ANE tries to create its ExtensionContext.
Does anyone have any suggestions for me? Is there a tricky way for me to use the ANE within the SWC? Are there any other AIR Zip libraries I should try? I found one called Nochump, but it didn't look much different from Airxzip so I figured it would probably crash because of the same memory issues of downloading the large file before unzipping the files.
Any help would be greatly appreciated.
Steve Warren
Senior Software Developer
Speakaboos