Problem with memory and android 4

Nachtfalke75

Member
Licensed User
Longtime User
Hi,

i preload up to 40 bitmaps in my app like this one:
B4X:
For i = 1 To 40 Step 1
 w = 80%x
 h = 80%y
 If Activity.Height > 860 Then
   w = 420
   h = 700
    End If
   Animation(i).InitializeSample(File.DirAssets,"anim_"&pNr&"_"&i&".jpg", w, h)
Next
That works well on the most of the devices, but on the android 4 platform the app shuts down. i get a "Out of Memory" message in the debug monitor.
The debug from b4a says nothing :(
Anyone here, who can help me with that problem please?
 

Nachtfalke75

Member
Licensed User
Longtime User
I guess that your Android 4 device resolution is much higher than the other devices you test with.

You will need to reduce the width and height. The best solution is to resize the original images.

The original images are 700x420 px.
I tried 360x480 but it still do not work.
If i try to load more then 10 images, the app stops.

But if i load 40 !! images with 700x420 on a 2.2 device it works well.
On the emulator and the real device too.
:BangHead:
 
Upvote 0
Top