Understanding Tablet Input

For a traditional application, the program usually depends on an input event. What this means is that nothing happens until the user interacts with the app. Most apps have many different menus and text, and the code is responsible for sifting through it as soon as the user presses a button. In these cases, a traditional game loop isn’t necessary because there is nothing to do until a touch event happens. The same principle applies to older programs for phones that didn’t have touchscreens.

If you wish to make this sort of app, Android makes it very simple for you to add listeners to the various buttons and images on the screen. By performing specific actions when a button is pressed, you can manipulate the program’s ...

Get Beginning Android Tablet Games Programming 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.