This week has thrown a severe monkey wrench into my daily schedule.
Sometimes, life just happens.
But to make it up to you, O Gentle Reader, I share with you one of my most trafficked posts, from Logorrhea.
Enjoy.
Working on mobile devices forces one to make conscious decisions regarding coding choices, if for no other reason that resources are scarce (memory, screen size, bandwidth). Taking the easy route and ignoring wise mobile programming practices can take what could be a promising application and make it a disappointing user experience.
If you’ve spent any time with the Google Android SDK, and have tried to read a JPEG into a Bitmap using Media.getBitmap
, you’ve almost certainly run into this little gem of an error message:
bitmap size exceeds VM budget
Unfortunately, since Android caps all applications’ VMs at 16MB in size, it only takes one or two big image reads to get you into trouble, regardless of all the garbage collection and Bitmap recycles you may try (see code snippet at the end of this post for more on that).
So, what’s a programmer to do?
Well, the…
View original post 331 more words