Setup an Android project as you would normally.
Download Read_System_Library.jar file from HERE
Go to Project > Properties > Java Build Path > Libraries and click on “Add External JARs…” Then add in the Read_System_Library.jar file.
A Step-By-Step Tutorial To Get You Started ….
This tutorial will take you step-by-step through writing a simple Hello World application. It assumes that you have Eclipse setup to work with the Android SDK already.
Get the Read_System_Library.jar file from
Click “Finish” to generate the skeleton for a project. The rest of this tutorial assumes that you named your application “ReadSystemHello”.
Select your project in the “Package Explorer”, then go to “Project” > “Properties”. Select “Java Build Path” and click on the “Libraries” tab. Click on “Add external JARs…” and select the Read_System_Library.jar from step 1.
-After the line “public class ReadSystemHello extends Activity {“, add this line:import com.pgmsoft.library.ReadSystem;
-Add the following as the last line of the onCreate method:private ReadSystem sys_out;
sys_out = new ReadSystem(this);
-After that, you can use this metod to system call
String output = sys_out.call(“cat /proc/cpuinfo”);
In “output” you have standard STDOUT from system call, you can display it for example … in textview widget:
Build this app, install it on your Android device, and run it. You should see output from “cat /proc/cpuinfo” system call (same result like in adb shell)TextView display = (TextView) findViewById(R.id.you_text_view);
display.setText(output);