Hi,
I tried to write a code module which initializes all bitmaps that are in use in different activities, so they will be loaded only once in memory. In the activities the panels will bet set by setbackgroundimage(bitmap).
But then we noticed some (for us) strange behaviors.
InitializeSample:
If I try to initialize 30 big pictures (normaly 1920x1054) with InitializeSample, by parameters maxwidth 960 and maxheight 527. But there comes an oom message at picture 15. If I load a picture that is in size bigger then the max parameters, for example 1280x703 then there is no oom message and the code runs fine. It feals like there is no difference between InitializeSample and only Initialize. Maybe there is a problem in the framework?
Different ram usage on different devices by same code:
The same code running (15 initialized pictures) would allocate 25 Mb Ram at my Galaxy Tab 7.7, at my Galaxy Note round 50. Is there a realtion to the pixel density or why is this double sized?
Another question for my calculations?
Is each pixel in a bitmap object represented as 32 bit integer?
Because of the unreliability of the garbage collector I tried this way, because I've no idea how to free up memory in the activities.
My only thoughts at the moment are to reduce the full hd pictures to smaller ones, load this at main init. And stretch this by gravity in panel?
Thanks in advance.