android - OutOfMemory when having many images in the screen -
i have activity in android application image below:
legend:
- gray: background image covering whole screen;
- blue: 5 different sized circles;
- green: arbitrary image;
i animating circles using view animation (http://developer.android.com/guide/topics/graphics/view-animation.html) show 1 @ time.
but got outofmemory exception in devices , emulators used test.
i changed layout use 3 imageview instead, 1 one image of 3 inner circles, , others 1 outer circle each using same image file different sizes, , animating them enabling , disabling visibility property. i'm using 2 images instead of 5.
with approach stopped getting outofmemory exception, guess because loading , displaying less images before.
fyi, have different image sizes placed in folders:
- drawable-hdpi
- drawable-ldpi
- drawable-mdpi
- drawable-xhdpi
is memory limited? has have better solution suggest can keep using 5 circle images?
the application small there no point in going path of using opengl.
thanks!
yes, android system guarantees 16mb of memory 1 application, manufacturers can allow more (usually do). not restricted so, if exceed limit, can outofmemoryexception
on lot of devices low memory.
Comments
Post a Comment