Is it possible to keep track when my Android phone is startup and when it is shutdown? Where can I get the information about when and what time my Android phone is being shut down and also being start up. (shut down / start up - meaning that someone press the Power button to cause it to shut down / start up OR a program that cause it to start it or shut it.)

Information should look something similar like the following:


=========================================================
| Date          |  Time       |  Operation |   By       |
=========================================================
| 12 Dec 2012   |  11:59 PM   | Shutdown   |   User     |
| 13 Dec 2012   |  10:00 AM   | Startup    |   User     |
| 13 Dec 2012   |  10:59 AM   | Shutdown   |   Program  |
| 13 Dec 2012   |  02:16 PM   | Startup    |   User     |
=========================================================


If the shut down or start up is caused by a Program, it would be better to display the program name that cause it to shutdown.

Prefer method that does not require rooting and for Android version below 4.
My standard recommendation again here: Tasker, the most complete automation solution available for Android. Tasker can react on different events and perform tasks when they occur. So you could setup two profiles:


Profile "Startup":

Condition: Device Boot (this is boot_completed))
Task: Write File (with your information specified in the parameters)

Profile "Shutdown":

Condition: Device Shutdown
Task: Write File (with your information specified in the parameters)



For the text you can use Variables like e.g. %DATE. Only difficulty will be to determine whether the shutdown was caused by the user or a program -- no easy recipe here, especially not for un-rooted devices. This information might be extracted from the system logs somehow; but starting with JellyBean, this would require root permissions.