Chapter 20: Drawing Graphics

This entire chapter will be about the Android Canvas class and some related classes, including 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 create a game, we need to take control of every pixel that the Android device has to offer.

In this chapter, we will cover the following:

  • Understanding Canvas and related classes
  • Writing a Canvas-based demo app
  • Looking at the Android coordinate system so we know where to do our drawing
  • Learning about drawing and manipulating bitmaps
  • Writing a bitmap-based demo app

Let's draw!

Technical ...

Get Android Programming for Beginners - Third Edition 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.