For Android devices, is there any way to find out at what time ( or timestamp ) the device turned off?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I dont think there’s any predefined support for that. However, its easy to get this done with your custom logic. All, you need to do is to define a
BroadcastReceiverwhich listens for intentandroid.intent.action.ACTION_SHUTDOWN. Once it receives the intent, simply save the currentDatein SharedPreferences, SQLite or where ever you want. Later, the phone is booted, read the saved value to know the estimated time when the phone was shutdown. For example:receiver code:
and in AndroidManifest.xml