Chapter 20. Drawing Graphics

This entire chapter will be about the Android Canvas class and some related classes such as Paint, Color, and Bitmap. These classes combined bring great power when it comes to drawing to the screen. Sometimes, the default UI provided by the Android API isn't what we need. If we want to make a drawing app, draw graphs, or perhaps make a game, we need to take control of every pixel that the Android device has to offer.

In this chapter, we will do the following:

  • Talk about understanding the Canvas and related classes
  • Write a Canvas-based demo app
  • Look at the Android coordinate system so we know where to do our drawing
  • Learn about drawing and manipulating Bitmaps
  • Write a Bitmap-based demo app

Let's draw!

Understanding the Canvas ...

Get Android Programming for Beginners - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.