Android NDK: Beginner's Guide - Second Edition
eBook - ePub

Android NDK: Beginner's Guide - Second Edition

Sylvain Ratabouil

Share book
  1. 494 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Android NDK: Beginner's Guide - Second Edition

Sylvain Ratabouil

Book details
Book preview
Table of contents
Citations

About This Book

About This Book

  • Create high performance mobile applications with C/C++ and integrate with Java
  • Exploit advanced Android features such as graphics, sound, input, and sensing
  • Port and reuse your own or third-party libraries from the prolific C/C++ ecosystem

Who This Book Is For

Are you an Android Java programmer who needs more performance? Are you a C/C++ developer who doesn't want to bother with the complexity of Java and its out-of-control garbage collector? Do you want to create fast intensive multimedia applications or games? If you've answered yes to any of these questions then this book is for you. With some general knowledge of C/C++ development, you will be able to dive headfirst into native Android development.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on โ€œCancel Subscriptionโ€ - itโ€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youโ€™ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoโ€™s features. The only differences are the price and subscription period: With the annual plan youโ€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weโ€™ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Android NDK: Beginner's Guide - Second Edition an online PDF/ePUB?
Yes, you can access Android NDK: Beginner's Guide - Second Edition by Sylvain Ratabouil in PDF and/or ePUB format, as well as other popular books in Informatik & Anwendungsentwicklung. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781783989652

Android NDK Beginner's Guide Second Edition


Table of Contents

Android NDK Beginner's Guide Second Edition
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
Sections
Time for action โ€“ heading
What just happened?
Have a go hero โ€“ heading
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Setting Up Your Environment
Getting started with Android development
Setting up Windows
Time for action โ€“ preparing Windows for Android development
What just happened?
Installing Android development kits on Windows
Time for action โ€“ installing Android SDK and NDK on Windows
What just happened?
Setting up OS X
Time for action โ€“ preparing OS X for Android development
What just happened?
Installing Android development kits on OS X
Time for action โ€“ installing Android SDK and NDK on OS X
What just happened?
Setting up Linux
Time for action โ€“ preparing Ubuntu for Android development
What just happened?
Installing Android development kits on Linux
Time for action โ€“ installing Android SDK and NDK on Ubuntu
What just happened?
Installing the Eclipse IDE
Time for action โ€“ installing Eclipse with ADT on your OS
What just happened?
Setting up the Android emulator
Time for action โ€“ creating an Android virtual device
What just happened?
Developing with an Android device
Time for action โ€“ setting up an Android device
What just happened?
More about ADB
Summary
2. Starting a Native Android Project
Building NDK sample applications
Time for action โ€“ compiling and deploying San Angeles sample
What just happened?
Generating project files with Android manager
Compiling native code with NDK-Build
Building and packaging an application with Ant
Deploying an application package with Ant
Launching an application with ADB Shell
More about Android tooling
Creating your first native Android project
Time for action โ€“ creating a native Android project
What just happened?
Introducing Dalvik and ART
Interfacing Java with C/C++
Time for action โ€“ calling C code from Java
What just happened?
Debugging native Android applications
Time for action โ€“ debugging a native Android application
What just happened?
Defining NDK application-wide settings
NDK-GDB day-to-day
Analyzing native crash dumps
Time for action โ€“ analyzing a native crash dump
What just happened?
Deciphering crash dumps
Setting up a Gradle project to compile native code
Time for action โ€“ creating a native Android project
What just happened?
Time for action โ€“ using your own Makefiles with Gradle
What just happened?
Summary
3. Interfacing Java and C/C++ with JNI
Initializing a native JNI library
Time for action โ€“ defining a simple GUI
What just happened?
Time for action โ€“ initializing the native store
What just happened?
Converting Java strings in native code
Time for action โ€“ handling strings in the native store
What just happened?
Native character encoding
JNI String API
Passing Java primitives to native code
Time for action โ€“ handling primitives in the native store
What just happened?
Have a go hero โ€“ passing and returning other primitive types
Referencing Java objects from native code
Time for action โ€“ saving references to Objects in native Store
What just happened?
Local references
Global references
Weak references
Managing Java arrays
Time for action โ€“ handling Java arrays in native Store
What just happened?
Primitive arrays
Have a go hero โ€“ handling other array types
Object arrays
Raising and checking Java exceptions
Time for action โ€“ raising & catching exceptions in native Store
What just happened?
Executing code in Exception state
Exception handling API
Summary
4. Calling Java Back from Native Code
Calling Java back from native code
Time for action โ€“ determining JNI method signatures
What just happened?
Time for action โ€“ calling back Java from native code
What just happened?
More on the JNI Reflection API
Debugging JNI
Synchronizing Java and native threads
Time for action โ€“ allocating an object with JNI
What just happened?
Time for action โ€“ running and synchronizing a thread
What just happened?
Synchronizing Java and C/C++ with JNI Monitors
Attaching and detaching native threads
Processing bitmaps natively
Time for action โ€“ decoding a camera's feed
What just happened?
Time for action โ€“ processing pictures with the Bitmap API
What just happened?
Registering native methods manually
JNI in C versus JNI in C++
Summary
5. Writing a Fully Native Application
Creating a native Activity
Time for action โ€“ creating a basic native Activity
What just happened?
More about the Native App Glue
Handling Activity events
Time for action โ€“ stepping the event loop
What just happened?
Time for action โ€“ handling Activity events
What just happened?
Accessing window surface natively
Time for action โ€“ displaying raw graphics
What just happened?
Measuring time natively
Time for action โ€“ animating graphics with a timer
What just happened?
Summary
6. Rendering Graphics with OpenGL ES
Initializing OpenGL ES
Time for action โ€“ initializing OpenGL ES
What just happened?
Time for action โ€“ clearing and swapping buffers
What just happened?
An insight into the OpenGL pipeline
Loading textures using the Asset manager
Time for action โ€“ reading assets with the Asset manager
What just happened?
More about the Asset Manager API
Time for action โ€“ compiling and embedding libpng module
What just happened?
Time for action โ€“ loading a PNG image
What just happened?
Time for action โ€“ generating an OpenGL texture
What just happened?
More about textures
Drawing 2D sprites
Time for action โ€“ initializing OpenGL ES
What just happened?
Vertex Arrays versus Vertex Buffer Object
Rendering particle effec...

Table of contents