Note that there are some explanatory texts on larger screens.

plurals
  1. POAnimated backround for my android activity using Eclipse and ADT
    text
    copied!<p>I want to create a background that covers the whole screen of my Activity. Just like:</p> <pre><code> android:background="@drawable/background" </code></pre> <p>But I want this background to be <code>animated</code> (60 frames), looping and target as many device resolutions as possible.</p> <p>I tried to do a <code>drawble</code> <code>.jpg</code> sequence, but the problem is that I use 1920x1080, and the logcat while trying to test it on the emulator, the application crashes, and LogCat gives me en error saying, <code>not enough memory</code></p> <p>Then I tried to import a <code>video</code> of my sequence and set it to play on the background. But I don't know where to put the <code>video</code> in my <code>res</code> folder and call it from there with <code>SetVideoPath()</code>, in order to play it.</p> <p>What is the best approach for an animated background, that covers multiple devices with different resolutions?</p> <p>@Arun C Thomas</p> <p>I still get an error in logcat,</p> <p>OutOfMemoryError</p> <p>my code is this:</p> <pre><code>package combiolab.biolab; import android.app.Activity; import android.graphics.drawable.AnimationDrawable; import android.opengl.GLSurfaceView; import android.opengl.GLSurfaceView.Renderer; import android.os.Bundle; import android.view.WindowManager; public class MainActivity extends Activity { private Renderer graphicsRenderer; //public static String gl; AnimationDrawable anim; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); GLSurfaceView myGLSurfaceView = (GLSurfaceView) findViewById(R.id.gl); myGLSurfaceView.setEGLConfigChooser(true); myGLSurfaceView.setRenderer(graphicsRenderer); } &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" &gt; &lt;android.opengl.GLSurfaceView android:id="@+id/gl" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;/android.opengl.GLSurfaceView&gt; &lt;/RelativeLayout&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload