Chapter 2

Gaming Tricks for Phones or Tablets

In this chapter, you will get your feet wet with native development in Android. You learn how easy it is to build a simple Android app that loads a native library and executes methods written in C within Java. You also learn how to call back Java methods within C, so the communication goes both ways between the languages. Next you learn 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. And finally, you tackle multitouch, which is a useful subject for advanced games such as first person shooters and others. Multitouch can be a tricky subject so check it out. But first, you’ll learn how to add native ...

Get Pro Android Games, 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.