Time for action – initializing the native store

We need to create and initialize all the structures we will use for the next section of the chapter:

  1. Create the jni/Store.h file, which defines store data structures:
    • The StoreType enumeration will reflect the corresponding Java enumeration. Leave it empty for now.
    • The StoreValue union will contain any of the possible store values. Leave it empty for now too.
    • The StoreEntry structure contains one piece of data in the store. It is composed of a key (a raw C string made from char*), a type (StoreType), and a value (StoreValue).

      Note

      Note that we will see how to set up and use C++ STL strings in Chapter 9, Porting Existing Libraries to Android.

    • Store is the main structure that defines a fixed size array of ...

Get Android NDK Beginner's Guide - Second Edition 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.