I am new to Android, and I need some advices for start up.
I want to build an application, which will show up, when the user gets into some hot situation.
By hot situation I mean:
- the GPS/cell coordinates are in known zone;
- known Bluetooth device detected;
- known Wi-Fi network detected;
- weather info has change;
I see something running in background and when one of the clauses hit, it will trigger and open the app.
- How to get started?
- How do I make sure my app won’t be shut down?
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.
Regards,
Pentium10
You need to use a
Servicefor the part of your application that runs in the background.You might find the Application Fundamentals document in the Android Developer Documentation helpful. It says this about Services:
In you case you might find the
LocationManagerService helpful. It is a system Service which will you can use to notify your application based on GPS position.However, I think you’ll have to write your own Services to monitor Wi-fi, Bluetooth and weather.
You can use the
AlarmManagerService to get your Service to perform particular tasks at certain intervals.