scummvm/scummvm — pull request #235 by tobigun (2012-04-29 15:53:09+00:00)
Title: ANDROID: disable compression for zip-file assets

At the moment themes are packed into zip-files without compression. When such a zip-file is added to the apk package (basically a zip-file) with aapt the file will be compressed automatically.
This is fine for scummvm as theme zip-files are not that big. But for residualvm the modern.zip file's size is 1.4 MB which causes trouble:
- First, before android 2.3 there seems to be a restriction on the size of an asset: the uncompressed size must not be greater than 1 MB, which is the case for the 1.4 MB modern.zip.
- Second, on phones with android >= 2.3 (like my Samsung Galaxy S plus) it takes almost one minute until the GUI is displayed because uncompressing the theme is very slow. Most of the time is spent in ZipArchive::listMembers(), probably because opening a file handle with MID_openFd fails in AndroidAssetArchive::createReadStreamForMember() [Error: "This file can not be opened as a file descriptor; it is probably compressed"].

This problem can be solved by compressing the zip-file contents instead of using an uncompressing zip and disable compression for zip-files in aapt (-0 zip). This is done by the patch.