Skip to main content

Posts

Showing posts from November, 2014

Why shouldn't static variables be used as global variables in Android development

For mobile devices with small memories, memory usage and care of applications is essential. If an application uses images, it can easily result a memory leak if they cannot be collected by garbage collector. A reason why GB couldn't collect unused objects is that those objects refers to a static variable. So, if you are setting a property of a local variable with a static one, you need to be double careful.