Android Question How not to waste memory?

FJS

Active Member
Licensed User
Longtime User
Good afternoon,

I have two questions:

1- I have tried to use "recycle", like this

Dim Obj1 As Reflector
Obj1.Target=puntuacionini
Obj1.RunMethod("recycle")
where puntuacionini is a bitmapdata, but it doesnot work, Do you know why?

2- Please could you give us any "gold rules" to create apps and games and save memory??, is there any information in the forum??

For example, when we waste memory, when "Dim bitmap1 as bitmapdata" or when i load the file??

Thank you very much for the help like always:)
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
ok Erel, thank you for your help, I am going to try it this evening.
However I have further comments:
1- the image sizes are the minimum, I use IU.LoadScaledBitmap with all the images to scale them just with its size
2- Is possible free the memory of the maps (and other objets), instantly?, for example in my case I have 3 minigames, when I open one of them, I would like free the memory of the list of map in the others.

Thank you very much
I hope my case will help to the rest of the forum
:)
1. You can make them smaller than the target size.
2. The memory problems you encounter are related to the bitmaps. Other objects footprint is much smaller.
 
Upvote 0

FJS

Active Member
Licensed User
Longtime User
With the following sentence (at manifest editor):
B4X:
SetApplicationAttribute(android:largeHeap,"true")

The app works great, in the table (10").
Now I am going to work on the code to truy to do it more efficiente.


Thank you very much for all your help, to all the forum people, and especially to informatix and Erel!!:):):)
 
Upvote 0
Top