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 ...

Get Sams Teach Yourself Android Game Programming in 24 Hours 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.