memory of drawables, is it better to have resources inside APK, outside APK or is it the same for me
Posted
by Daniel Benedykt
on Stack Overflow
See other posts from Stack Overflow
or by Daniel Benedykt
Published on 2010-01-05T12:20:01Z
Indexed on
2010/06/09
16:42 UTC
Read the original article
Hit count: 308
Hi
I have an application that draws a lot of graphics and change them. Since I have many graphics, I thought of having the images outside the APK, downloaded from the internet as needed, and saved on the files application folder.
But I started to get outOfMemory exceptions.
The question is: Does android handle memory different if I load a graphic from APK than if I load it from 'disk'?
code using APK:
topView.setBackgroundResource(R.drawable.bg);
code if image is outside APK:
Drawable d = Drawable.createFromPath(pathName); topView.setBackgroundDrawable(d);
Thanks
Daniel
© Stack Overflow or respective owner