Android NDK

Android NDK Essentials

Course Description

This course is intended to teach the students about Android NDK, which is a toolset that allows developers
to put into practice a part of or an entire Android application in a native language. This course will make students debug an Android NDK application with logging messages and Check JNI. This course covers concepts such as writing essential JNI code, calling external libraries in android, working with CPU features, multithreading. Main motivation for native code is performance and the re-use of legacy code.

Who Should attend:
This course is intended for developers who want to write native code in android.

Duration: 2-3 Days

Prerequisite:

  • Must have attended the Android Application Essentials

Objective:

  • Android NDK OpenGL ES API
  • Android NDK
  • Porting and Using the Existing Libraries with Android NDK
  • NDK
  • Java Native Interface
  • Android Native Application API
  • Other Android NDK API
  • Android NDK Multithreading
  • Build and Debug NDK Applications
  • Porting an Existing Application to Android with NDK

1. Introduction to JNI and Android NDK

1.1. Introduction to JNI
1.2. Introduction to Android NDK
1.3. Install and setup NDK for Android Studio
1.4. What is included in NDK (tools and libraries)
1.5. Project setup for NDK
1.5.1.1. CMake
1.5.1.2. NDK Build

2. JNI

2.1. Loading native libraries and registering native methods
2.2. Passing parameters and receiving returns in primitive types
2.3. Manipulating strings in JNI
2.4. Managing references in JNI
2.5. Manipulating classes in JNI
2.6. Manipulating objects in JNI
2.7. Manipulating arrays in JNI
2.8. Accessing Java static and instance fields in the native code
2.9. Calling static and instance methods from the native code
2.10. Caching jfieldID, jmethodID, and referencing data to improve performance
2.11. Checking errors and handling exceptions in JNI

3. Android NDK

3.1. CMake file
3.2. NDK Build file
3.3. Incorporating native libraries in applications
3.4. Incorporating third party libraries
3.5. Calling Java code from native code
3.6. Logging
3.7. Managing resource and assets using NDK
3.8. Application data natively
3.9. Libjnigraphics
3.10. Managing multiple threads

4. Porting existing libraries to Android with NDK

4.1. Porting a library as a shared library module
4.2. Porting a library as a static library module
4.3. Application using shared and static libraries

5. OpenGL ES using NDK

5.1. Project Setup
5.2. EGL setup using NDK
5.3. OpenGL ES Shaders
5.4. Basic OpenGL ES rendering