O'Reilly logo

Sams Teach Yourself Android Game Programming in 24 Hours by Jonathan S. Harbour

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

Hour 5. Getting Started with Graphics

What You’ll Learn in This Hour

• How the Activity class works.

• How to print text to the screen using TextView.

• How to create a custom View.

• How to draw graphics using Canvas.

The Canvas class is a Java class in the Android SDK with features (that is, functions or methods) for drawing. You can draw all sorts of shapes and images using the Canvas class. We are going to study this class and learn how to use it for drawing graphics as an important first step on the path of programming games on the Android platform. This is the primary way to draw in Android. We’ll spend most of our attention on Canvas. Because this is the first hour on graphics programming, but we have not covered the basics of making ...

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