How to move image up and down continuously using translate animation in android?

You need to set the repeat property

android:repeatMode

int. How an animation behaves when it reaches the end of the animation. android:repeatCount must be set to a positive integer or "-1" for this attribute to have an effect. Set to "reverse" to have the animation reverse direction with each iteration or "repeat" to have the animation loop from the beginning each time.

Animation a;
a.setRepeatMode(Animation.REVERSE);

Modify your code according to this:

   mScanner.setVisibility(View.VISIBLE);
   mAnimation = new TranslateAnimation(
            TranslateAnimation.ABSOLUTE, 0f,
            TranslateAnimation.ABSOLUTE, 0f,
            TranslateAnimation.RELATIVE_TO_PARENT, 0f,
            TranslateAnimation.RELATIVE_TO_PARENT, 1.0f);
   mAnimation.setDuration(10000);
   mAnimation.setRepeatCount(-1);
   mAnimation.setRepeatMode(Animation.REVERSE);
   mAnimation.setInterpolator(new LinearInterpolator());
   mScanner.setAnimation(mAnimation);

And moreover use xml rather than image. Please see the below code and put it in your ImageView src.

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="line">
    <solid android:color="#0000FF"/>
    <size android:width="480dp"
        android:height="10dp"/>
    <corners android:radius="1dp"/>
    <stroke android:width="3dp"
        android:color="#000000"/>
</shape>

I hope it will help you.