Maybe you can get an idea about this ...
TranslateAnimation animation = new TranslateAnimation (0.0f, 400.0f, 0.0f, 0.0f);
// new TranslateAnimation (xFrom, xTo, yFrom, yTo)
animation.setDuration(2000);
animation.setRepeatCount(100);
animation.setRepeatMode(2);
img_animation.startAnimation(animation);
source
share