Android Animation You'll need to create a class derived from View that does your animation. In that class you'll need the following variables:

h = new Handler();
int frameRate;
/****************************************************************************
 * Create a new thread that will let us time the rate of the ball.  It
* causes the screen to be redrawn. ****************************************************************************/
private Runnable r = new Runnable() { @Override public void run() { invalidate(); } };

At the end of the onDraw method that draws the screen, you'll need the following code, where the variable frameRate is the number of milliseconds to delay before running the thread.  What will happen is that the screen will be drawn, but since the animation is not running, the thread will be called once, then done.  Every time you update the ball's position, the thread will run and update the screen.  For most games try frameRate values of around 10 to 60.

h.postDelayed(r, frameRate);