[android-developers] Re: Context.startService - The service does not stay running...

2009-02-07 Thread Jon Colverson
Look into the PowerManager: http://code.google.com/android/reference/android/os/PowerManager.html -- Jon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email

[android-developers] DisplayMetrics screen DPI seems to be wrong on G1?

2009-01-13 Thread Jon Colverson
I'm trying to find out the physical size of the device's screen using this code in my activity's onCreate(): DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); On my G1 metrics.xdpi is 159.3723 and metrics.ydpi is 320.8401. That doesn't

[android-developers] Re: Strange behavior with AlarmManager.RTC_WAKEUP and PowerManager.WakeLock

2008-12-06 Thread Jon Colverson
On Dec 5, 7:56 am, Jon Colverson [EMAIL PROTECTED] wrote: On Dec 5, 6:41 am, Jon Colverson [EMAIL PROTECTED] wrote: I'd been having some weird issues with AlarmManager seemingly not firing my alarms when the device is asleep. I'm using the alarm to start a service and I was acquiring my

[android-developers] Re: Strange behavior with AlarmManager.RTC_WAKEUP and PowerManager.WakeLock

2008-12-04 Thread Jon Colverson
On Nov 29, 12:15 pm, Noam  Wolf [EMAIL PROTECTED] wrote: I have a BroadcastReceiver which acquires a lock onReceive.  I use an alarm manager with AlarmManager.RTC_WAKEUP set to broadcast my intent.  I have found that when the phone is locked (and asleep) it will not wake up sometimes, and

[android-developers] Re: Strange behavior with AlarmManager.RTC_WAKEUP and PowerManager.WakeLock

2008-12-04 Thread Jon Colverson
On Dec 5, 6:41 am, Jon Colverson [EMAIL PROTECTED] wrote: I'd been having some weird issues with AlarmManager seemingly not firing my alarms when the device is asleep. I'm using the alarm to start a service and I was acquiring my wake lock in onStart(). I tried acquiring the lock in onCreate

[android-developers] Is there a hook to run code on device shutdown (power off)?

2008-11-20 Thread Jon Colverson
Hello. Part of the app I'm writing is a Service that does some work. If it hasn't finished when the user switches the device off I'd like to be able to save my state to a file and then restart the Service when the device starts up again. I can see how to start it up again (receive the

[android-developers] Re: Is there a hook to run code on device shutdown (power off)?

2008-11-20 Thread Jon Colverson
Eek. That makes things a bit more difficult. Thank you for the quick response, though! On Nov 20, 9:55 pm, Dianne Hackborn [EMAIL PROTECTED] wrote: Sorry, there is nothing available to find out when the device is being turned off. On Thu, Nov 20, 2008 at 5:37 AM, Jon Colverson [EMAIL

<    1   2