Apress Pro Android C++ with the NDK (2012).pdf

(7368 KB) Pobierz
Building graphic-rich and better performing
native applications
Pro
Android C++
with the NDK
Onur Cinar
992917850.031.png 992917850.042.png 992917850.052.png 992917850.063.png 992917850.001.png
 
 
 
 
 
 
 
 
992917850.002.png 992917850.003.png 992917850.004.png 992917850.005.png 992917850.006.png 992917850.007.png 992917850.008.png 992917850.009.png
 
 
 
 
 
 
 
992917850.010.png 992917850.011.png 992917850.012.png 992917850.013.png
 
 
992917850.014.png 992917850.015.png 992917850.016.png 992917850.017.png 992917850.018.png 992917850.019.png
 
 
992917850.020.png 992917850.021.png 992917850.022.png 992917850.023.png 992917850.024.png 992917850.025.png 992917850.026.png 992917850.027.png 992917850.028.png 992917850.029.png 992917850.030.png 992917850.032.png 992917850.033.png 992917850.034.png 992917850.035.png 992917850.036.png 992917850.037.png 992917850.038.png 992917850.039.png 992917850.040.png 992917850.041.png 992917850.043.png 992917850.044.png 992917850.045.png 992917850.046.png 992917850.047.png
 
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.
992917850.048.png 992917850.049.png 992917850.050.png 992917850.051.png 992917850.053.png 992917850.054.png 992917850.055.png 992917850.056.png 992917850.057.png 992917850.058.png 992917850.059.png 992917850.060.png 992917850.061.png 992917850.062.png 992917850.064.png 992917850.065.png
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
992917850.066.png
vi
Contents at a Glance
Chapter 12: Native Graphics API
���������������������������������������������������������������������������������� 285
Chapter 13: Native Sound API
������������������������������������������������������������������������������������� �� 335
Chapter 14: Proiling and NEON Optimization
������������������������������������������������������������� �363
Index�������������������������������������������������������������������������������������������������������������������������������� 381
992917850.067.png
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.
1
992917850.068.png
Zgłoś jeśli naruszono regulamin