One of the more challenging problems after my recent update of the Android SDK was that the app was throwing an out of memory error on startup, at loading images.
After some deeper analysis of the problem, it seems that images have to be loaded effectively, and memory efficiently.
My solution is: defined image views in the layouts should not reference the drawable resources in the configuration. It is more efficient to set the image views after the view is actually in use.
So remove all "android:src=@drawable/..." from the xml files, unless are used.
Set them in code, when they actually get used. And, make sure to load only the scaled size of image needed for the view.
Loading bitmaps in an appropriate scale also makes your app memory efficient. More here
Sunday, March 09, 2014
Tuesday, July 30, 2013
Animal Sounds for Toddlers and Kids
Wednesday, January 19, 2011
Android - a new year
One of my New Year's resolutions is, to develop Android applications, again.
I plan to develop for the Android users some useful and cool applications. As I think these might just be useful for other smartphone users as well, such as iPhone, Blackberry, and so on, I have decided to use PhoneGap.
This is a very promising framework for developing mobile applications, platform indenpendently. I am just through with the tutorial for Android applications using Eclipse. And I am pleasantly surprised.
No hidden tricks, everything went just fine.
Check out the tutorial yourself:
I plan to develop for the Android users some useful and cool applications. As I think these might just be useful for other smartphone users as well, such as iPhone, Blackberry, and so on, I have decided to use PhoneGap.
This is a very promising framework for developing mobile applications, platform indenpendently. I am just through with the tutorial for Android applications using Eclipse. And I am pleasantly surprised.
No hidden tricks, everything went just fine.
Check out the tutorial yourself:
Subscribe to:
Posts (Atom)