Skip to Content
Android Native Development Kit Cookbook
book

Android Native Development Kit Cookbook

by Liu Feipeng
March 2013
Intermediate to advanced
346 pages
8h 4m
English
Packt Publishing
Content preview from Android Native Development Kit Cookbook

Managing data for native threads at Android NDK

There are several options when we want to preserve thread-wide data across functions, including global variables, argument passing, and thread-specific data key. This recipe discusses all the three options with a focus on thread-specific data key.

Getting ready...

Readers are recommended to read the Creating and terminating native threads at Android NDK recipe and the Synchronizing native threads with mutex at Android NDK recipe in this chapter before this one.

How to do it...

The following steps will help us create an Android project that demonstrates data management at Android NDK:

  1. Create an Android application named NativeThreadsData. Set the package name as cookbook.chapter6.nativethreadsdata. Please ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Android 9 Development Cookbook - Third Edition

Android 9 Development Cookbook - Third Edition

Rick Boyer
Android High Performance Programming

Android High Performance Programming

Enrique López Mañas, Diego Grancini
Learning Embedded Android N Programming

Learning Embedded Android N Programming

Ivan Morgillo, Stefano Viola
Learning Android, 2nd Edition

Learning Android, 2nd Edition

Marko Gargenta, Masumi Nakamura

Publisher Resources

ISBN: 9781849691505Other