How large resolution images does B4A support?

IamBot

Member
Licensed User
Longtime User
Im downloading images with resolution 2592x1944 from a database and my program manages to read and display a few of them (in separate TwoLinesAndBitmap lines) but after a while my program crashes saying "Unfortunately, *programname* has stopped". This error does not occur when I use images with lot less quality. Is it the resolution or something else that causes this?
 

thedesolatesoul

Expert
Licensed User
Longtime User
Do you know how large resolution B4A can handle?
It is not a B4A limitation. It is more of an android imposed limitation.
Read here: Displaying Bitmaps Efficiently | Android Developers

Especially this:
Mobile devices typically have constrained system resources. Android devices can have as little as 16MB of memory available to a single application. The Android Compatibility Definition Document (CDD), Section 3.7. Virtual Machine Compatibility gives the required minimum application memory for various screen sizes and densities. Applications should be optimized to perform under this minimum memory limit. However, keep in mind many devices are configured with higher limits.

Bitmaps take up a lot of memory, especially for rich images like photographs. For example, the camera on the Galaxy Nexus takes photos up to 2592x1936 pixels (5 megapixels). If the bitmap configuration used is ARGB_8888 (the default from the Android 2.3 onward) then loading this image into memory takes about 19MB of memory (2592*1936*4 bytes), immediately exhausting the per-app limit on some devices.
 
Upvote 0
Top