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

2008-11-21 Thread Eric Mill

Dianne, do you think this will be added to the API in the future?
Saving state on phone shutdown could be important for some apps.

-- Eric

On Nov 20, 9:12 pm, Jon Colverson [EMAIL PROTECTED] wrote:
 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 PROTECTED] wrote:

   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 ACTION_BOOT_COMPLETED
   Intent), but I can't figure out a way to run the saving code on
   shutdown. I was expecting my Service's onDestroy() to be called, but
   this doesn't seem to be the case.

   Thanks.

   --
   Jon

  --
  Dianne Hackborn
  Android framework engineer
  [EMAIL PROTECTED]

  Note: please don't send private questions to me, as I don't have time to
  provide private support.  All such questions should be posted on public
  forums, where I and others can see and answer them.

 --
 Jon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---



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

2008-11-21 Thread Dorn Hetzel

And at least with respect to the current hardware instance (G1) is any
inability a hardware, firmware, or software limitation?

On Fri, Nov 21, 2008 at 9:39 AM, Eric Mill [EMAIL PROTECTED] wrote:

 Dianne, do you think this will be added to the API in the future?
 Saving state on phone shutdown could be important for some apps.

 -- Eric

 On Nov 20, 9:12 pm, Jon Colverson [EMAIL PROTECTED] wrote:
 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 PROTECTED] wrote:

   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 ACTION_BOOT_COMPLETED
   Intent), but I can't figure out a way to run the saving code on
   shutdown. I was expecting my Service's onDestroy() to be called, but
   this doesn't seem to be the case.

   Thanks.

   --
   Jon

  --
  Dianne Hackborn
  Android framework engineer
  [EMAIL PROTECTED]

  Note: please don't send private questions to me, as I don't have time to
  provide private support.  All such questions should be posted on public
  forums, where I and others can see and answer them.

 --
 Jon
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---



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

2008-11-21 Thread Dianne Hackborn
It's something not implemented in the software.  Users seem to have a
disturbing habit of just pulling the battery out as a way to turn off their
phone, so I'm not sure how much I would want to rely on a clean shutdown. :}

On Fri, Nov 21, 2008 at 7:52 AM, Dorn Hetzel [EMAIL PROTECTED] wrote:


 And at least with respect to the current hardware instance (G1) is any
 inability a hardware, firmware, or software limitation?

 On Fri, Nov 21, 2008 at 9:39 AM, Eric Mill [EMAIL PROTECTED] wrote:
 
  Dianne, do you think this will be added to the API in the future?
  Saving state on phone shutdown could be important for some apps.
 
  -- Eric
 
  On Nov 20, 9:12 pm, Jon Colverson [EMAIL PROTECTED] wrote:
  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 PROTECTED]
 wrote:
 
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
 ACTION_BOOT_COMPLETED
Intent), but I can't figure out a way to run the saving code on
shutdown. I was expecting my Service's onDestroy() to be called, but
this doesn't seem to be the case.
 
Thanks.
 
--
Jon
 
   --
   Dianne Hackborn
   Android framework engineer
   [EMAIL PROTECTED]
 
   Note: please don't send private questions to me, as I don't have time
 to
   provide private support.  All such questions should be posted on
 public
   forums, where I and others can see and answer them.
 
  --
  Jon
  
 

 



-- 
Dianne Hackborn
Android framework engineer
[EMAIL PROTECTED]

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---



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

2008-11-20 Thread Dianne Hackborn
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 PROTECTED] wrote:


 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 ACTION_BOOT_COMPLETED
 Intent), but I can't figure out a way to run the saving code on
 shutdown. I was expecting my Service's onDestroy() to be called, but
 this doesn't seem to be the case.

 Thanks.

 --
 Jon

 



-- 
Dianne Hackborn
Android framework engineer
[EMAIL PROTECTED]

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---



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

2008-11-20 Thread Dorn Hetzel

If not actual shutdown, is it possible to detect presses of the red
button that *might* result in a power down?

On Thu, Nov 20, 2008 at 4: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 PROTECTED] wrote:

 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 ACTION_BOOT_COMPLETED
 Intent), but I can't figure out a way to run the saving code on
 shutdown. I was expecting my Service's onDestroy() to be called, but
 this doesn't seem to be the case.

 Thanks.

 --
 Jon





 --
 Dianne Hackborn
 Android framework engineer
 [EMAIL PROTECTED]

 Note: please don't send private questions to me, as I don't have time to
 provide private support.  All such questions should be posted on public
 forums, where I and others can see and answer them.


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---



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

2008-11-20 Thread Dianne Hackborn
No, sorry.

On Thu, Nov 20, 2008 at 2:14 PM, Dorn Hetzel [EMAIL PROTECTED] wrote:


 If not actual shutdown, is it possible to detect presses of the red
 button that *might* result in a power down?

 On Thu, Nov 20, 2008 at 4: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 PROTECTED]
 wrote:
 
  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 ACTION_BOOT_COMPLETED
  Intent), but I can't figure out a way to run the saving code on
  shutdown. I was expecting my Service's onDestroy() to be called, but
  this doesn't seem to be the case.
 
  Thanks.
 
  --
  Jon
 
 
 
 
 
  --
  Dianne Hackborn
  Android framework engineer
  [EMAIL PROTECTED]
 
  Note: please don't send private questions to me, as I don't have time to
  provide private support.  All such questions should be posted on public
  forums, where I and others can see and answer them.
 
 
  
 

 



-- 
Dianne Hackborn
Android framework engineer
[EMAIL PROTECTED]

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---



[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 PROTECTED] wrote:

  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 ACTION_BOOT_COMPLETED
  Intent), but I can't figure out a way to run the saving code on
  shutdown. I was expecting my Service's onDestroy() to be called, but
  this doesn't seem to be the case.

  Thanks.

  --
  Jon

 --
 Dianne Hackborn
 Android framework engineer
 [EMAIL PROTECTED]

 Note: please don't send private questions to me, as I don't have time to
 provide private support.  All such questions should be posted on public
 forums, where I and others can see and answer them.

--
Jon

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---