Programming with the dynamic linker library in Android NDK

Dynamic loading is a technique to load a library into memory at runtime, and execute functions or access variables defined in the library. It allows the app to start without these libraries.

We have seen dynamic loading in almost every recipe of this book. When we call the System.loadLibrary or System.load function to load the native libraries, we are using dynamic loading.

Android NDK has provided the dynamic linker library to support dynamic loading in NDK, since Android 1.5. This recipe discusses the dynamic linker library functions.

Getting ready...

Readers are expected to know how to create an Android NDK project. You can refer to the Writing a Hello NDK program recipe of Chapter 1

Get Android Native Development Kit Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.