team-mount-ventoux / JayPS-AndroidApp

JayPS (Pebble Bike/Ventoo) Android App
http://www.pebblebike.com
MIT License
44 stars 14 forks source link

Make GPS service foreground to prevent to be killed by the system #5

Closed jay3 closed 11 years ago

jay3 commented 11 years ago

http://developer.android.com/guide/components/services.html#Foreground A foreground service is a service that's considered to be something the user is actively aware of and thus not a candidate for the system to kill when low on memory. A foreground service must provide a notification for the status bar, which is placed under the "Ongoing" heading, which means that the notification cannot be dismissed unless the service is either stopped or removed from the foreground. For example, a music player that plays music from a service should be set to run in the foreground, because the user is explicitly aware of its operation. The notification in the status bar might indicate the current song and allow the user to launch an activity to interact with the music player.