android中怎么打开串口功能
1个回答
2017-10-16
展开全部
1/yiyaaixuexi/article/details/6803593
3.每次都在java层去提权,cmd为提权命令
public void exeShell(String cmd){
try{
Process p = Runtime.getRuntime().exec(cmd);
BufferedReader in = new BufferedReader(
new InputStreamReader(
p.getInputStream()));
String line = null;
while ((line = in.readLine()) != null) {
Log.i("exeShell",line);
}
}
catch(Throwable t)
{
t.printStackTrace();
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询