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

Chapter 2. Java Native Interface

In this chapter, we will cover the following recipes:

  • Loading native libraries and registering native methods
  • Passing parameters and receiving returns in primitive types
  • Manipulating strings in JNI
  • Managing references in JNI
  • Manipulating classes in JNI
  • Manipulating objects in JNI
  • Manipulating arrays in JNI
  • Accessing Java static and instance fields in native code
  • Calling static and instance methods from native code
  • Caching jfieldID, jmethodID, and reference data to improve performance
  • Checking errors and handling exceptions in JNI
  • Integrating assembly code in JNI

Introduction

Programming with Android NDK is essentially writing code in both Java and native languages such as C, C++, and assembly. Java code runs on Dalvik Virtual ...

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