Hello my friends,
I have a little problem with my game. It's simple enough, i mask almost hole screen with a canvas(panel), and you have to touch the hole screen to unmask it(trasparent color). So the problem emerging when you have to initialize in each level the canvas again and again. After a dozen of plays, you can understand that game become slower until it crashes because outofmemory. I read somewhere that canvas, if it's big enough costs a lot of memory. I tried to free memory with java.lang but it does not work cause canvas it is loaded in panel(in order to catch the X and Y). That problem emerging only at slower devices like samsung galaxy S3. I tested at S4, S5, Note 3, Note 4 and it is working like a charm. If you want more details, feel free to ask.
Thank in advance for your time
I have a little problem with my game. It's simple enough, i mask almost hole screen with a canvas(panel), and you have to touch the hole screen to unmask it(trasparent color). So the problem emerging when you have to initialize in each level the canvas again and again. After a dozen of plays, you can understand that game become slower until it crashes because outofmemory. I read somewhere that canvas, if it's big enough costs a lot of memory. I tried to free memory with java.lang but it does not work cause canvas it is loaded in panel(in order to catch the X and Y). That problem emerging only at slower devices like samsung galaxy S3. I tested at S4, S5, Note 3, Note 4 and it is working like a charm. If you want more details, feel free to ask.
Thank in advance for your time