如何将命令从我的android应用程序发送到android终端模拟器?
我想将命令从我的Android应用程序发送到Android终端模拟器 下面是我的代码如何将命令从我的android应用程序发送到android终端模拟器?,android,Android,我想将命令从我的Android应用程序发送到Android终端模拟器 下面是我的代码 public void onClick(View p1) { // TODO: Implement this method Intent i=new Intent(Intent.ACTION_SEND); i.setType("*/*"); i.setPackage("jackpal.androidterm"); i.putExtra(Intent.EXTRA_TEXT,
public void onClick(View p1)
{
// TODO: Implement this method
Intent i=new Intent(Intent.ACTION_SEND);
i.setType("*/*");
i.setPackage("jackpal.androidterm");
i.putExtra(Intent.EXTRA_TEXT,"date");
startActivity(i);
}
要执行shell命令,您不需要终端仿真器应用程序。Android基于Linux内核,因此您可以直接执行shell命令 试试这个代码
// Command to execute
String command = "date";
ShellExecuter exe = new ShellExecuter();
String outp = exe.Executer(command);
out.setText(outp);
Log.d("Output", outp);
问题在哪里???????