售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Android Native Development Kit Cookbook
Table of Contents
Android Native Development Kit Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Hello NDK
Introduction
Setting up an Android NDK development environment in Windows
Getting ready
How to do it…
How it works…
There's more…
Setting up an Android NDK development environment in Ubuntu Linux
Getting ready
How to do it…
How it works…
There's more…
Setting up an Android NDK development environment in Mac OS
Getting ready
How to do it…
How it works…
Updating Android NDK
Getting ready
How to do it…
How it works…
There's more…
Writing a Hello NDK program
Getting ready
How to do it…
How it works…
There's more…
2. Java Native Interface
Introduction
Loading native libraries and registering native methods
Getting ready
How to do it…
How it works…
Passing parameters and receiving returns in primitive types
Getting ready
How to do it…
How it works…
Manipulating strings in JNI
Getting ready
How to do it
How it works…
There's more…
Managing references in JNI
How to do it…
How it works…
There's more…
Manipulating classes in JNI
Getting ready
How to do it…
How it works…
Manipulating objects in JNI
Getting ready
How to do it…
How it works…
Manipulating arrays in JNI
Getting ready
How to do it…
How it works…
Accessing Java static and instance fields in the native code
Getting ready
How to do it…
How it works…
Calling static and instance methods from the native code
Getting ready
How to do it…
How it works…
Caching jfieldID, jmethodID, and referencing data to improve performance
Getting ready
How to do it…
How it works…
Checking errors and handling exceptions in JNI
Getting ready
How to do it…
How it works…
There's more...
Integrating assembly code in JNI
Getting ready
How to do it…
How it works…
3. Build and Debug NDK Applications
Introduction
Building an Android NDK application at the command line
Getting ready
How to do it…
How it works…
There's more...
Taking screenshots from the command line
Building an Android NDK application in Eclipse
Getting ready
How to do it…
How it works...
Building an Android NDK application for different ABIs
Getting ready
How to do it...
How it works…
Building Android NDK applications for different CPU features
Getting ready
How to do it…
How it works…
There's more…
More about CPU feature detection
Different approaches of building for different cpu features
Debugging an Android NDK application with logging messages
How to do it…
How it works...
Debugging an Android NDK application with CheckJNI
How to do it...
How it works...
Debugging an Android NDK application with NDK GDB
Getting ready
How to do it...
How it works...
Debugging an Android NDK application with CGDB
Getting ready
How to do it...
How it works...
Debugging an Android NDK application in Eclipse
Getting ready
How to do it...
How it works...
There's more...
4. Android NDK OpenGL ES API
Introduction
Drawing 2D Graphics and applying transforms with the OpenGL ES 1.x API
Getting ready
How to do it...
How it works...
OpenGL ES rendering display through GLSurfaceView
Drawing objects at OpenGL ES
Colors at OpenGL ES
OpenGL ES transformation
Drawing 3D graphics and lighting up the scene with the OpenGL ES 1.x API
Getting ready
How to do it...
How it works...
Mapping texture to 3D objects with the OpenGL ES 1.x API
Getting ready
How to do it...
How it works...
There's more...
Drawing 3D graphics with the OpenGL ES 2.0 API
Getting ready
How to do it...
How it works...
OpenGL Shading Language (GLSL)
How to use shader:
There's more...
Displaying graphics with EGL
Getting ready
How to do it...
How it works...
Window management
There's more...
5. Android Native Application API
Introduction
Creating a native activity with the native_activity.h interface
Getting ready
How to do it…
How it works…
There's more…
Creating a native activity with the Android native app glue
Getting ready
How to do it…
How it works…
Managing native windows at Android NDK
Getting ready
How to do it…
How it works…
Detecting and handling input events at Android NDK
Getting ready
How to do it…
How it works…
Accessing sensors at Android NDK
Getting ready
How to do it…
How it works…
Managing assets at Android NDK
Getting ready
How to do it…
How it works…
There's more…
6. Android NDK Multithreading
Introduction
Creating and terminating native threads at Android NDK
Getting ready…
How to do it...
How it works...
Build with pthreads
Thread creation
Thread termination
Synchronizing native threads with mutex at Android NDK
How to do it...
How it works...
Initialize and destroy mutex
Using the mutex
There's more...
Synchronizing native threads with conditional variables at Android NDK
How to do it...
How it works...
Initialize and destroy conditional variables
Using the conditional variable:
There's more...
Conditional variable attributes functions
Timed conditional variable functions
Synchronizing native threads with reader/writer locks at Android NDK
Getting ready...
How to do it...
How it works...
Initialize and destroy a reader/writer lock
Using a reader/writer lock
There's more...
Timed read/write lock and trylock
Reader/writer lock attribute functions
Synchronizing native threads with semaphore at Android NDK
Getting ready...
How to do it...
How it works...
Initialize and destroy a semaphore
Using a semaphore
Scheduling native threads at Android NDK
Getting ready...
How to do it...
How it works...
Scheduling contention scope
Scheduling policy and thread priority
Scheduling using nice value/level
Managing data for native threads at Android NDK
Getting ready...
How to do it...
How it works...
Creation and deletion of thread-specific data key
Set and get thread-specific data
7. Other Android NDK API
Introduction
Programming with the jnigraphics library in Android NDK
Getting ready…
How to do it...
How it works...
There's more…
Programming with the dynamic linker library in Android NDK
Getting ready...
How to do it...
How it works...
Programming with the zlib compression library in Android NDK
Getting ready...
How to do it...
How it works...
There's more...
Programming audio with the OpenSL ES audio library in Android NDK
Getting ready...
How to do it...
How it works...
Object creation
Changing states of objects
Use and build with OpenSL ES Audio library
OpenSL ES audio recording
OpenSL ES audio playback
There's more...
Programming with the OpenMAX AL multimedia library in Android NDK
Getting ready...
How to do it...
How it works...
Use and build with the OpenMAX AL multimedia library:
OpenMAX AL video playback
There's more....
8. Porting and Using the Existing Libraries with Android NDK
Introduction
Porting a library as a shared library module with the Android NDK build system
Getting ready
How to do it...
How it works...
See also
Porting a library as a static library module with the Android NDK build system
Getting ready
How to do it...
How it works...
See also
Porting a library with its existing build system using the Android NDK toolchain
How to do it...
How it works...
There's more...
Using a library as a prebuilt library
How to do it...
How it works...
Using a library in multiple projects with import-module
How to do it...
How it works...
Porting a library that requires RTTI, exception, and STL support
How to do it...
How it works...
9. Porting an Existing Application to Android with NDK
Introduction
Porting a command-line executable to Android with an NDK build system
Getting ready
How to do it...
How it works...
Understanding the Android.mk files
Porting a command-line executable to Android with an NDK standalone compiler
Getting ready
How to do it...
How it works...
Porting libpng
Porting libseamcarv
Porting fusch
Adding GUI to a ported Android app
How to do it...
How it works...
Using background threads at porting
Getting ready
How to do it...
How it works...
Sending messages from the native code
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜