On Oct 20, 1:18 am, Zen <[EMAIL PROTECTED]> wrote:
> 1. How to make a background process, like a service?

Use the Service class.

> 2. Will I need to set to phone power always on to make this work?

You can use wake locks with the PowerManager to control when the CPU
is running.

> 3. If the phone goes to sleep mode, will the gps position changing
> event wake it up? I guess only if the gps chip has a interrupt you can
> set to...

The GPS position is changing (slightly) all of the time, so no it
won't wake up the phone just for that.

You need to be really, really careful about how you do this in the
background so you don't kill the user's device.  First, if you are
going to continually monitor the GPS...  don't.  You can expect
battery life of 5 hours or less if you do that.  So you need to set
the AlarmManager to wake you up at some slow interval (not less than
every 10 seconds) at which point you sample the current position and
go back to sleep.  You'll want to play around with this on a real
device to tune it to have good performance, and definitely want to let
the user know this is happening and allow them to stop your background
monitoring.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to