O'Reilly logo

Android NDK Game Development Cookbook by Viktor Latypov, Sergey Kosarevsky

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Enumerating files in the .zip archives

To incorporate the contents of a .zip file seamlessly into our filesystem, we need to read the archive contents and be able to access each file individually. Since we are developing our own file I/O library, we use the iIStream interface to access .zip files. The NDK provides a way to read the .apk assets from your C++ application (see usr/include/android/asset_manager.h in your NDK folder). However, it is only available on Android 2.3, and will make debugging of file access in your game more complex on a desktop computer without an emulator. To make our native code portable to previous Android versions and other mobile operating systems, we will craft our own assets reader.

Note

Android applications are distributed ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required