Switch Off

Story

The powerbutton of my nexus one broke. So I had to flash the excellent cyanogenmod (for unlocking the phone with the trackball) and I had to find a solution for switching the phone off via the desktop (if I dont want to wait 15s). There are several options in the market. e.g. Lock Screen Widget and Lock Screen App. But I wanted to see what kind of API android provides for this. And indeed, the Device Admin API is very interesting.