Building graphic-rich and better performing
native applications
Android C++
with the
NDK
Onur Cinar
Pro
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
Contents at a Glance
About the Author ½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½
xix
About the Technical Reviewer ½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½
xxi
Preface ½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½
xxiii
■
Chapter 1: Getting Started with C++ on Android ½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½1
■
Chapter 2: Exploring the Android NDK½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½41
■
Chapter 3: Communicating with Native Code using JNI ½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½67
■
Chapter 4: Auto-Generate JNI Code Using SWIG ½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½95
■
Chapter 5: Logging, Debugging, and Troubleshooting ½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½127
■
Chapter 6: Bionic API Primer ½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½155
■
Chapter 7: Native Threads ½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½179
■
Chapter 8: POSIX Socket API: Connection-Oriented Communication ½½½½½½½½½½½½½½½½½½½½½½½½½½½½209
■
Chapter 9: POSIX Socket API: Connectionless Communication ½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½247
■
Chapter 10: POSIX Socket API: Local Communication½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½259
■
Chapter 11: C++ Support ½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½275
v
vi
Contents at a Glance
■
Chapter 12: Native Graphics API ½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½285
■
Chapter 13: Native Sound API ½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½335
■
Chapter 14: Profiling and NEON Optimization ½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½363
Index ½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½½381
Chapter
1
Getting Started with C++
on Android
Needless to say, exploring and practicing are the best methods for learning. Having a fully functional
development environment ready at the very beginning of this book will enable you to explore and
experiment with the material while working through the chapters. The Android C++ development
environment is mainly formed by the following components:
Android Software Development Kit (SDK)
Android Native Development Kit (NDK)
Android Development Tools (ADT) Plug-In for Eclipse
Java Development Kit (JDK)
Apache ANT Build System
GNU Make Build System
Eclipse IDE
This chapter will provide step-by-step instructions for setting up the proper Android C++ development
environment. Android development tools are provided for the major operating systems:
Microsoft Windows
Apple Mac OS X
Linux
Since the requirements and the installation procedure vary depending on the operating system,
the following sections will walk you through the steps for setting up the Android C++ development
environment based on the operating system. You can skip over the ones that don’t apply to you.
Download at http://www.pin5i.com/
1
评论