get resource from server for animation
<p>I have developed an app which has Frame by Frame animation. I am getting resources from drawable folder. So the size of my apk is huge. Now I would like to get resources from server, but I am unable to come up with an idea to do this.
i have put my code over here    </p>

<p><strong>main.xml ::</strong> </p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
&gt;
&lt;ImageView android:id="@+id/simple_anim"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_centerHorizontal="true"
/&gt;
&lt;TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Hello World, XMLAnimation"
/&gt;
&lt;Button android:text="Button" 
android:id="@+id/button1" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content"&gt;&lt;/Button&gt;
&lt;/LinearLayout&gt; 
</code></pre>

<p><strong>frame_animation_girl.xml ::</strong> </p>

<pre><code>&lt;animation-list xmlns:android=
 "http://schemas.android.com/apk/res/android"
android:oneshot="false"&gt;
       &lt;item android:drawable="@drawable/girl0001" android:duration="20" /&gt;
       &lt;item android:drawable="@drawable/girl0002" android:duration="20" /&gt;
       &lt;item android:drawable="@drawable/girl0003" android:duration="20" /&gt;
       &lt;item android:drawable="@drawable/girl0004" android:duration="20" /&gt;
       &lt;item android:drawable="@drawable/girl0005" android:duration="20" /&gt;
       &lt;item android:drawable="@drawable/girl0006" android:duration="20" /&gt;
  &lt;/animation-list&gt;
</code></pre>

<p><strong>Java file ::</strong></p>

<pre><code>        ImageView img = (ImageView) findViewById(R.id.simple_anim);
        img.setBackgroundResource(R.drawable.frame_animation_girl);

        MyAnimationRoutine mar = new MyAnimationRoutine();
        MyAnimationRoutine2 mar2 = new MyAnimationRoutine2();

        Timer t = new Timer(false);
        t.schedule(mar, 100);
        Timer t2 = new Timer(false);
        t2.schedule(mar2, 5000);
        Buttona = (Button) findViewById(R.id.button1);
        final Intent animationIntent = new Intent(this, TranningIntent.class);
        Buttona.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {

                startActivity(animationIntent);
                finish();
            }
        });
    }

    class MyAnimationRoutine extends TimerTask {
        MyAnimationRoutine() {
        }

        public void run() {
            ImageView img = (ImageView) findViewById(R.id.simple_anim);
            // Get the background, which has been compiled to an
            // AnimationDrawable object.
            AnimationDrawable frameAnimation = (AnimationDrawable) img
                    .getBackground();

            // Start the animation (looped playback by default).
            frameAnimation.start();
        }
    }

    class MyAnimationRoutine2 extends TimerTask {
        MyAnimationRoutine2() {
        }

        public void run() {
            ImageView img = (ImageView) findViewById(R.id.simple_anim);
            // Get the background, which has been compiled to an
            // AnimationDrawable object.
            AnimationDrawable frameAnimation = (AnimationDrawable) img
                    .getBackground();

            // stop the animation (looped playback by default).
            /* frameAnimation.stop(); */
        }
    }
}
</code></pre>
