On Thu, Jun 2, 2011 at 6:34 AM, Edam <[email protected]> wrote: > I have also read that the alarm manager might be a better solution. >
It is. > Could I use the alarm manager to wake the service at certain > intervals (i.e. 5 mins) to check if the criteria is met? > Yes. > It would need to get the latest position from the location manager as part > of the check and possibly call the web-service to get the latest info. > OK - you can do that. Look at IntentService. > > Is it possible to then wake the phone, play a sound and vibrate if > the criteria is met? > Yes. > Its needs to be something like when you get a text message, enough > that the user will notice the alert and look at the phone. > That's what Notifications are for. > I know there are issues with the wake lock and the phone sleeping again > before the alert is displayed. > You can specify whether your Alarm should wake the phone to do it's thing, if it's that important. > > I suspect that some people will say that I should not do any background > stuff as it drains the battery. > If your app requires "background stuff" to function and your users understand this, then that's what needs to be done. What you should not do is *waste* the user's battery doing pointless things like polling or actions that require user interaction while the phone is asleep and not even being used. > I would give the user the option to turn off the background stuff if they > want to and also set the frequency. > Good. ------------------------------------------------------------------------------------------------- TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

