O'Reilly logo

Android User Interface Development by Jason Morris

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - building an example game: "guess my number"

We want to build a simple example that will save and restore its state from a Bundle object. For this example, we have a very simple "guess my number" game. The Activity object picks a number between one and ten and challenges the user to guess it.

The basic user interface layout for this example will need a label telling the user what to do, an input area for them to input their guess, and a button to tell the application they wish to input a guess. The following diagram is a basic idea of how the user interface should be structured:

Time for action - building an example game: "guess my number"

If the user were to get an SMS while playing this game, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required