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—programmatically defined animation

Oh no! We forgot about one of the dance moves - we'd better add it back in! But you're probably getting a bit tired of defining animations in XML, so let's use a simple routine to generate the last animation when the FunkyActivity first loads.

We won't replace anything we wrote in the previous Time for action—making the stick man interactive, but we'll add another button and associated animation.

  1. Open up the Funky Stick Man Eclipse project again.
  2. Open up res/layout/main.xml and add one more button:
    <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" ...

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