Using SuperUser on Rooted Devices
In Chapter: System and Device Control
Author: Ian Darwin ('idarwin')
You need root access to do something (non-nefarious) on the user's behalf, and you're running on a 'rooted' device.
Get your permissions from "superuser", which will ask the user whether you should be granted root access.
If you found this recipe useful, why not
buy the book
and have the whole collection always at hand?"