Android Tutorial: Frame Animation With Multiple Images

In Android Animations are used in many ways like Splash screen or Layout animation between two activities , moving from one activity to the other you can see some moving animation. 
In Android Two kinds of animations available.
  • Tween animation :- Tween animation can perform a series of simple transformations like position, size, rotation, and transparency on widgets(Button,Text view etc).
  • Frame By Frame Animation :- it animate images in sequence. it means it show images in sequence like Gif file or Film.
In this tutorial I will show you how you can create Frame by Frame Animation to show images in sequence on splash screen. usually splash screen is not good in application (See developer review) but if you require some sort of back ground work when application starts you can use splash screen. Splash screen are known as evil because when you display it for longer time user get frustrated and may close your application or may remove it. but if you are creating game or application for some specific website then you can use splash screen to display logo of that website (Like Facebook app). lets start the new application for Frame by Frame Animation.
  • Create New Application. (Go to File > New >Android Application Project )

  • Now Click Next  > Next and Give Splash Activity name for java and splash.xml.
  • Now Go to splash.xml File and add Image view in it.


  • Now Go to and put the below code.

package com.androprogrammer.frameanimation;

import android.os.Bundle;
import android.os.Handler;
import android.content.Intent;
import android.view.Menu;
import android.widget.ImageView;

public class SplashActivity extends Activity {

 ImageView iv1;
 AnimationDrawable Anim;
 protected void onCreate(Bundle savedInstanceState) {
  iv1 = (ImageView) findViewById(;
  try {
   BitmapDrawable frame1 = (BitmapDrawable) getResources().getDrawable(
   BitmapDrawable frame2 = (BitmapDrawable) getResources().getDrawable(
   BitmapDrawable frame3 = (BitmapDrawable) getResources().getDrawable(

   Anim = new AnimationDrawable();
   Anim.addFrame(frame1, 200);
   Anim.addFrame(frame2, 200);
   Anim.addFrame(frame3, 200);
   final Handler handler = new Handler();
   handler.postDelayed(new Runnable() {

    public void run() {
   }, 5000);
  } catch (Exception e) {
   // TODO: handle exception

So This will start animating your images in sequence. in above code i have used handler that start new thread and call Start() method of Animation object. to display splash screen in full screen ( no action bar or application name in Api 11 or below ) you have to add the below code in manifest file. in activity tag add this code 

Screen Shots

So this will allow to show splash images in full screen. i hope this will be helpful in your application.if you find helpful tutorial on this site subscribe to our blog or share it with your friends. 


  1. This comment has been removed by a blog administrator.

  2. thanks for your time .. will give it shot . i am falling in lve with andoid .. man android L is far beyond amazing