Book Image

Android NDK: Beginner's Guide

By : Sylvain Ratabouil
Book Image

Android NDK: Beginner's Guide

By: Sylvain Ratabouil

Overview of this book

Table of Contents (18 chapters)
Android NDK Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Converting Java strings in native code


The first kind of entry we will handle is strings. Strings, which are represented as (almost) classic objects in Java, can be manipulated on the native side and translated to native strings, that is, raw character arrays, thanks to JNI. Strings are a first-class citizen despite their complexity inherent to their heterogeneous representations.

In this part, we will send Java strings to the native side and translate them to their native counterpart. We will also convert them back to a Java string.

Note

The resulting project is provided with this book under the name Store_Part5.