[Android Runtime] Every Android application runs in its own process, with its own instance of the Dalvik virtual machine. Dalvik has been written so that a device can run multiple VMs efficiently. The Dalvik VM executes files in the Dalvik Executable…
try { // Executes the command. Process process = Runtime.getRuntime().exec(cmd); // NOTE: You can write to stdin of the command using // process.getOutputStream(). BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStrea…
Android Runtime使得直接调用底层Linux下的可执行程序或脚本成为可能 比如Linux下写个测试工具,直接编译后apk中通过Runtime来调用 或者写个脚本,apk中直接调用,省去中间层或者JNI 这个至少效率应该比较高吧 代码: public class test extends Activity { TextView text; /** Called when the activity is first created. */ @Override public void on…