Book Image

Android NDK Beginner's Guide

By : Sylvain Ratabouil
Book Image

Android NDK Beginner's Guide

By: Sylvain Ratabouil

Overview of this book

<p>Android NDK is all about injecting high performance into your apps. Exploit the maximum power of these mobile devices using high-performance and portable code.</p> <p>This book will show you how to create C/C++ enabled applications and integrate them with Java. You will learn how to access native API and port libraries used in some of the most successful Android applications.</p> <p>Using this practical step-by-step tutorial, highlighted with comments and tricks, discover how to run C/C++ code embedded in a Java application or in a standalone application. You will create a real native application starting from project creation through to full implementation of native API and the porting of existing third-party libraries. You will discover OpenGL ES and OpenSL ES, which are becoming the new standard in mobility. You will also understand how to access keyboard and input peripherals and how to read accelerometer or orientation sensors.</p> <p>Finally, you will dive into more advanced topics such as debugging and troubleshooting applications. By the end of the book, you should know the key elements to enable you to start exploiting the power and portability of native code.</p>
Table of Contents (19 chapters)
Android NDK Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Summary


OpenGL and graphics, in general, is a really vast domain. One book is not enough to cover it entirely. But drawing 2D graphics with textures and buffer objects opens the door to much more advanced stuff! In more detail, we have learned how to initialize and bind OpenGL ES to the Android windows with EGL. We have also loaded a PNG texture packaged as assets with an external library. Then, we have drawn sprites efficiently with OpenGL ES extensions. This technique should not be overused as it can impact performance when many sprites are blitted. Finally, we have rendered a tile map efficiently by pre-computing rendered tiles in vertex and index buffers.

With the knowledge acquired here, the road to OpenGL ES 2 is at a perfectly walkable distance! But if you cannot wait to see 3D graphics, Chapter 9, Porting Existing Libraries to Android and Chapter 10, Towards Professional Gaming, are your next destination to discover how to embed a 3D engine. But if you are a bit more patient, let...