Chapter 2

Gaming Tricks for Phones or Tablets

This chapter contains a lot of goodies to get your feet wet with native development in Android.

We begin by showing you how easy it is to build a simple Android app that loads a native library and executes methods written in C within Java. But it also shows how you can call back Java methods within C, so the communication goes both ways between the languages.

Next we look at how we can 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.

And then we tackle multitouch, which is a useful subject for advanced games such as shooters and others. Multitouch can be a tricky subject so check it out.

Finally we end ...

Get Advanced Android 4 Games 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.