M Mousa Najafi Member Licensed User Longtime User Dec 9, 2014 #1 I've used customlistview class to design a google's voice search like app.The listview has 10 panels that each one includes small image (20 kB or less) and 2 labels and a button. It works smoothly at first but ram usage increasing after every activty create or pause which fired by device rotation or back button pressing and finally leads to app crash. I searched forums and tried most solutions like as following: - declaring bitmap variblas in process globals and loading by bitmaploadsample just one time by usinf firsttime in activity create - clearing listview in activty pause Project files are attached , I couldn't includes whole project files and just source code and images included due to file size more than 512 KB Actually customlistview was the best solution to design voice search like user interface but this bug puzzled me. Please help me to overcome this issue
I've used customlistview class to design a google's voice search like app.The listview has 10 panels that each one includes small image (20 kB or less) and 2 labels and a button. It works smoothly at first but ram usage increasing after every activty create or pause which fired by device rotation or back button pressing and finally leads to app crash. I searched forums and tried most solutions like as following: - declaring bitmap variblas in process globals and loading by bitmaploadsample just one time by usinf firsttime in activity create - clearing listview in activty pause Project files are attached , I couldn't includes whole project files and just source code and images included due to file size more than 512 KB Actually customlistview was the best solution to design voice search like user interface but this bug puzzled me. Please help me to overcome this issue
Erel B4X founder Staff member Licensed User Longtime User Dec 9, 2014 #2 Have you tested it in Release mode? I've tested in in rapid debug mode (in B4A v4 which improves the debugger memory handling) and wasn't able to reproduce this. I changed the orientation more than 20 times. Upvote 0
Have you tested it in Release mode? I've tested in in rapid debug mode (in B4A v4 which improves the debugger memory handling) and wasn't able to reproduce this. I changed the orientation more than 20 times.
M Mousa Najafi Member Licensed User Longtime User Dec 9, 2014 #3 thanks for your fast reply. I've tested in release mode on the galaxy S4 mini and galaxy S5 . In Both devices ram increasing after orientation changes and sometimes take longer time to crash and sometimes crashes easily also it crashed just on S5 Actually I am not intending to swith another customlistview libraries for this app because your customlistview class was easy to implement my UI. Is B4A v4 available to download? Upvote 0
thanks for your fast reply. I've tested in release mode on the galaxy S4 mini and galaxy S5 . In Both devices ram increasing after orientation changes and sometimes take longer time to crash and sometimes crashes easily also it crashed just on S5 Actually I am not intending to swith another customlistview libraries for this app because your customlistview class was easy to implement my UI. Is B4A v4 available to download?
Erel B4X founder Staff member Licensed User Longtime User Dec 9, 2014 #4 V4 beta version was released. However the memory related changes only affect the rapid debugger. Your code can be optimized. You do need to load the font each time that the activity is created. Load it once and store it in a process global variable. Instead of drawing the line on each panel you should draw it once (when FirstTime is true) on a mutable bitmap and then add the bitmap to the panels (with ImageView). Upvote 0
V4 beta version was released. However the memory related changes only affect the rapid debugger. Your code can be optimized. You do need to load the font each time that the activity is created. Load it once and store it in a process global variable. Instead of drawing the line on each panel you should draw it once (when FirstTime is true) on a mutable bitmap and then add the bitmap to the panels (with ImageView).
M Mousa Najafi Member Licensed User Longtime User Dec 10, 2014 #5 Thank you so much for your kind help Mr. Erel Doing your suggestion decreased the ram usage too much(from 50 meg to 6 at start) and solved crash problem. still I will optimize more by declaring images bitmap as process global variable since there is a small ram increasing after every screen rotation Upvote 0
Thank you so much for your kind help Mr. Erel Doing your suggestion decreased the ram usage too much(from 50 meg to 6 at start) and solved crash problem. still I will optimize more by declaring images bitmap as process global variable since there is a small ram increasing after every screen rotation