you can use different frame of image put in the drawable folder named first.png,second.png etc for animation effect and load it after certain interval of time.
create animation_list.xml and put it.
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item android:drawable="@drawable/first" android:duration="210" />
<item android:drawable="@drawable/second" android:duration="210" />
<item android:drawable="@drawable/third" android:duration="210" />
<item android:drawable="@drawable/fourth" android:duration="210" />
<item android:drawable="@drawable/fifth" android:duration="210" />
<item android:drawable="@drawable/sixth" android:duration="210" />
</animation-list>
Then in MainActivity code is.create imageview named yourImageView in the activity_main xml
import android.os.Bundle;
import android.app.Activity;
import android.graphics.drawable.AnimationDrawable;
import android.widget.ImageView;
public class MainActivity extends Activity {
private AnimationDrawable frameAnimation;
private ImageView view;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Type casting the Image View
view = (ImageView) findViewById(R.id.yourImageView);
// Setting animation_list.xml as the background of the image view
view.setBackgroundResource(R.drawable.animation_list);
// Type casting the Animation drawable
frameAnimation = (AnimationDrawable) view.getBackground();
frameAnimation.start();
}
}