Android Out of Memory Error

  • Replies:1
Carlos Vásquez
  • Forum posts: 1

Aug 12, 2014, 2:05:21 AM via Website

I´m new developing, so please don´t be so hard on me if I ask a stupid question. I´m trying to run an app with drawableIanimations, but not buttons or pop ups animations neither, I mean, an animation frame by frame from a 2 to 4 seconds video. I extract from a 2 to 4 seconds video, 10 to 30 frames per second. Some animations has the android:oneshot set to false and some set to true. So, I´m trying to develop an app, with a RelativeLayout and an ImageView on it, then a LinearLayout with 10 Buttons to start each animation. My app runs well at first, but sometimes it stop and I get the Out of Memory Error. I don´t know if the structure I choose is right or I´m doing something wrong. Here, I give you some info about what I´m doing, for you to help me or give a good advice or put me on the right track about this app.

Images 10 animation of 4 second each. 30 images each second. 1200 images. If I make images for each size of screen, I know I will kill the memory, so I only using images in the drawable-ldpi directory. I don´t know if its that ok.

screenOrientation="portrait" all the time.

Each image size: 135x240 21.8kb

I hope someone can help me or just give me an advice to go on... Thanks in advance. Regards

Reply
Frangulyan
  • Forum posts: 18

Aug 24, 2014, 1:11:23 PM via Website

the really bad workaround would be to add

android:largeHeap="true"

in your manifest. I would rather find a memory optimization though

Reply