title: How to move a image like a endless road in android?
body: <p>I am new to android.I want to develop a car moving app.I want to run a road image endlessly so that the user will think the car is moving.Please help me.Below is what I have tried so far,</p>
  
  <p>Image_MoveActivity</p>
  
  <pre><code>package com.image;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.View;
  import android.view.animation.Animation;
  import android.view.animation.TranslateAnimation;
  import android.widget.ImageView;
  
  public class Image_moveActivity extends Activity {
      /** Called when the activity is first created. */
      private ImageView mScanner, mScanner1,mScanner2;
      private Animation mAnimation,mAnimation1, mAnimation2;
  
      @Override
      public void onCreate(Bundle savedInstanceState) 
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          mScanner = (ImageView)findViewById(R.id.imageView1);
          mScanner1 = (ImageView)findViewById(R.id.imageView3);
          mScanner2 = (ImageView)findViewById(R.id.imageView4);
          mAnimation = new TranslateAnimation(0, 0, 0, 500);
          mAnimation1 = new TranslateAnimation(5, 5, 5, 500);
          mAnimation2 = new TranslateAnimation(5, 5, 5, 500);
          mAnimation.setDuration(10000);
          mAnimation.setFillAfter(true);
         mAnimation.setRepeatCount(Animation.INFINITE);
          mAnimation.setRepeatMode(Animation.INFINITE);
          mScanner.setAnimation(mAnimation);
          mScanner.setVisibility(View.VISIBLE);
      mAnimation1.setDuration(100);
          mAnimation1.setFillAfter(true);
         mAnimation1.setRepeatCount(Animation.INFINITE);
      mAnimation1.setRepeatMode(Animation.INFINITE);
      mScanner1.setAnimation(mAnimation);
      mScanner1.setVisibility(View.VISIBLE);
      mAnimation2.setDuration(100);
      mAnimation2.setFillAfter(true);
     mAnimation2.setRepeatCount(Animation.INFINITE);
  mAnimation2.setRepeatMode(Animation.INFINITE);
  mScanner2.setAnimation(mAnimation);
  mScanner2.setVisibility(View.VISIBLE);
      }
  }
  </code></pre>
  
  <p>main.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical" android:background="@drawable/road"&gt;
  
  
      &lt;FrameLayout
          android:id="@+id/frameLayout1"
          android:layout_width="match_parent"
          android:layout_height="match_parent" &gt;
  
  
          &lt;ImageView
              android:id="@+id/imageView1"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:src="@drawable/road" /&gt;
  
          &lt;ImageView
              android:id="@+id/imageView2"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:src="@drawable/player" android:layout_gravity="bottom" android:layout_marginLeft="100dp"/&gt;
  
          &lt;ImageView
              android:id="@+id/imageView3"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:src="@drawable/car2" android:layout_gravity="right"/&gt;
  
          &lt;ImageView
              android:id="@+id/imageView4"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:src="@drawable/car3" android:layout_gravity="top|center" android:layout_marginLeft="15dp"/&gt;
  
      &lt;/FrameLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>