Game Development Reference
In-Depth Information
Summary
In this chapter, you took the first steps toward building a hybrid game using JNI by learning
how to create the main Java activity and loading a native library within it. Next, you learned
about Java native methods using the native keyword plus the C header file required to
implement them. You also learned some useful C tricks, such as converting Java arrays to C
arrays, getting the size of a Java array, and invoking Java methods within C.
You then learned how to cascade audio, video, key, and touch events from Java to C by
using thin Java wrappers that simply pass event information to the native library. Plus, you
learned about the Multitouch API, and how you can track multiple pointers across the screen
reacting accordingly.
This and the previous chapter have provided the basic foundation if you are planning to
port a game that has significant Linux C code to the Android platform. In Chapter 3, you will
tackle native OpenGL in more detail.
 
Search WWH ::




Custom Search