PNG is a complex format to read. So let's embed libpng third-party library:
Original libpng 1.5.2 archive is provided with this book in
Chapter6/Resource folder under the name
lpng152.zip. A second archive
lpng152_ndk.zip with the modifications made in the following steps is also available.
$ANDROID_NDK/sources/. Move all files from the libpng package in it.
libpng/scripts/pnglibconf.h.prebuiltinto root folder
libpngwith other source files. Rename it