O'Reilly logo

Android 3.0 Animations by Alex Shaw

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—making more realistic bubbles

Our bubbles scene needs a more realistic bubble. At the moment it looks a little bit like it was written for a computer in the 1980s.

Let us explore the Canvas and Paint tools to find a more effective graphical representation of a bubble. As we experiment with the available tools, we'll learn more about how to apply Canvas graphics to the display.

  1. Hey, I've got an idea! They say a picture is worth a thousand words, well what if they're wrong? Let's try replacing the picture of the bubble with the word "bubble".

    Good idea, eh? Open up Bubble.java and navigate to the draw() method. Replace the call to drawCircle with one to drawText, like the following:

    public void draw(Canvas c) { c.drawText("Bubble", ...

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