Bitmap too large - Out of Memory?
<p>I am trying to animate some movements of a person on my device. I have created a sprite sheet, which ends up being 1.23Mb. The image dimensions is 5000 by 1500 pix. The sheet has 8 rows, each is it's own action. (Walk on, bow, jump...). The longest action is 32 images. So the image is basically 32 columns, by 8 rows. So, now I load it:</p>

<p>As soon as I do this:</p>

<pre><code>private Bitmap bmp;
bmp = BitmapFactory.decodeResource(getResources(), R.drawable.myImage);
</code></pre>

<p>I get an error:</p>

<blockquote>
  <p>Thread [&lt;1> main] (Suspended (exception OutOfMemoryError))<br>
    BitmapFactory.decodeResource(Resources, int, BitmapFactory$Options)
  line: 385     BitmapFactory.decodeResource(Resources, int) line: 404<br>
    GameView.(Context) line: 25       FightActivity.onCreate(Bundle)
  line: 13      FightActivity(Activity).performCreate(Bundle) line: 4465<br>
    Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1049<br>
    ActivityThread.performLaunchActivity(ActivityThread$ActivityClientRecord,
  Intent) line: 1920<br>
    ActivityThread.handleLaunchActivity(ActivityThread$ActivityClientRecord,
  Intent) line: 1981        ActivityThread.access$600(ActivityThread,
  ActivityThread$ActivityClientRecord, Intent) line: 123<br>
    ActivityThread$H.handleMessage(Message) line: 1147<br>
    ActivityThread$H(Handler).dispatchMessage(Message) line: 99 
    Looper.loop() line: 137     ActivityThread.main(String[]) line: 4424<br>
    Method.invokeNative(Object, Object[], Class, Class[], Class, int,
  boolean) line: not available [native method]      Method.invoke(Object,
  Object...) line: 511      ZygoteInit$MethodAndArgsCaller.run() line: 784<br>
    ZygoteInit.main(String[]) line: 551     NativeStart.main(String[])
  line: not available [native method]</p>
</blockquote>

<p>Am I limited to a certain file size? Seems strange? And if so, is my only option to split the sprites onto separate 'action' images, as opposed to a sequence of action images per row in one large sprite sheet?</p>

<p>Hope someone can assist a novice.</p>
