How to create android apps with root access?

Fugogugo picture Fugogugo · Mar 25, 2011 · Viewed 34.9k times · Source

I found out that there's so many apps out there which required root access.

How were they able to create those apps? Where did they found all the resource? Is there any official document about the root access? Or will it need some hackish way?

And what kinds of access which required root access? Is proxy one of them? I didn't found any documentation about accessing the proxy anywhere.

=== UPDATE ===

I think some people mistaken by my question. I know that the phone need to be rooted to get root access. but the things I want to find out is, what kind of services are need root access? Some I see wireless tether, the other is to clear cache (is it even need root access just to clear cache?), and the other apps out there. is there any list of what I kind of advantage I get from root access?

Answer

Aleadam picture Aleadam · Mar 25, 2011

You need su installed in the phone (of course). Details here: http://forum.xda-developers.com/showthread.php?t=682828

And to use it, is as simple as running su command. Here is a sample I use to reboot the phone programmatically (copied from this answer: Android 2.2: Reboot device programmatically )

try {
    Runtime.getRuntime().exec("su");
    Runtime.getRuntime().exec("reboot");
} catch (IOException e) {
}