how to structure my app to run in background
<p>I am new to Android, and I need some advices for start up.<br>
I want to build an application, which will show up, when the user gets into some hot situation.</p>

<p>By hot situation I mean:  </p>

<ul>
<li>the GPS/cell coordinates are in known zone;  </li>
<li>known Bluetooth device detected;  </li>
<li>known Wi-Fi network detected;  </li>
<li>weather info has change;  </li>
</ul>

<p>I see something running in background and when one of the clauses hit, it will trigger and open the app.   </p>

<ul>
<li>How to get started?   </li>
<li>How do I make sure my app won't be shut down?   </li>
</ul>

<p>As I read somewhere that Android OS will terminate apps if memory out occurs or consumes too much, and my app would consume a lot, making repeated measures/checks to see if situation changed.</p>

<p>Regards,<br>
Pentium10</p>
