import android.app.Activity;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.widget.ImageView;
public class GenieComesOut extends Activity
{
ImageView genie;
AnimationDrawable genieout;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.genie_out);
genie = (ImageView)findViewById(R.id.genieout);
genieout = (AnimationDrawable) genie.getDrawable();
genie.post(new Runnable() {public void run() {genieout.start();}});
}
I got the animations to start going, i can only fit 20 frames in one, more than that i get VM wont allocate, these are full screen images, i have about 50 frames left, so, can i make a new /anim/xml switch onto the ImageView garbage collect and runnable another 20 frames, what is the proper way to do this? Thank you for your time
You should consider converting your animation to a video if that is really fullscreen. Video can then be played easily and won’t eat your memory.
Here is the list of supported formats: Android Supported Media Formats. You could use H264 or 3GP, try what looks best and performs better.