Draw and move animation from xml in android
<p>What I want to do:
I want to draw image from xml and then animate it from xml.
this image should move with constant speed anywhere on our screen.</p>

<p>Now the problem is:
I can draw and animate image from xml but i can not move this image with constant speed.</p>

<p>I am using two xml files: One for animate and other for moving.
XML for animation:

    
    
    
    
        android:duration="200"/></p>

<h2></h2>

<p>XML file for move:
</p>

<pre><code>&lt;translate
    android:interpolator="@android:anim/linear_interpolator"
    android:fromXDelta="2%"
    android:toXDelta="400%"
    android:fromYDelta="2%"
    android:toYDelta="800%"/&gt;
</code></pre>

<p></p>

<p>Activity.java file code in onCreate() method:</p>

<pre><code>  ImageView rocketImage = (ImageView) findViewById(R.id.rocket_image);
  Animation hyperspaceJump = AnimationUtils.loadAnimation(this,   R.anim.hyperspace_jump);      
  rocketImage.setBackgroundResource(R.drawable.rocket_thrust);
  AnimationDrawable rocketAnimation = (AnimationDrawable) rocketImage.getBackground();
  rocketAnimation.start();
  rocketImage.startAnimation(hyperspaceJump);
</code></pre>
