Ramiz Raja
Ramiz Raja

Reputation: 310

Writing to /proc File System from Android Activity in java

I have download Android source code and flashed it to device. I have written LKM which reads/writes information to /proc/myFile. I want to write to /proc/myFiLE file from my android activity but using java code not native. I know in native code we can can use system( ) system call to write using echo command but i do not know that how to write from java code? Thanks in advance.

Upvotes: 0

Views: 1382

Answers (2)

viraptor
viraptor

Reputation: 34145

Just treat them as normal files. You can use the usual File and *Stream objects to write what you need.

Upvotes: 2

Durairaj Packirisamy
Durairaj Packirisamy

Reputation: 4725

You can use something like this.

Runtime.getRuntime().exec("your command")

Upvotes: 0

Related Questions