Application class and object state
<p>I've been making a research about the Application class and the ways to keep objects state, I've read a lot of stuff all over the web, include the android documentation (lifecycle, recommendations, etc), many questions/answers about the subject, and other stuff and still have some doubts and i want to to have this part very clear to future development. I guess that this is a common problem for every android developer so i want to know what experience (and not just documentation) said about it. So i have some questions:</p>

<p>1- The Application class can be kill from memory or initialized being the app in foreground?? Just the case that i have a subclass of Application with some static variables that keep state, i know that if the app go to background it can be killed for memory and then restarted but can it happen when it is in foreground??</p>

<p>2- If the app memory can be erased or initialized in any moment by the OS the only reliable way to keep state of objects in by a database or files?? (Really hope NOT!!)</p>

<p>3- Any other tips that can help about this issue.</p>
