Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.IOException;
- import java.io.InputStream;
- import android.app.Activity;
- import android.os.Bundle;
- public class ProvaAtCommandsActivity extends Activity {
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- ReadCPUinfo();
- }
- private void ReadCPUinfo() {
- ProcessBuilder cmd;
- String result = "";
- try {
- String[] args = { "/system/bin/service",
- "call", "phone", "2", "s16", "+393274296037" };
- cmd = new ProcessBuilder(args);
- Process process = cmd.start();
- InputStream in = process.getInputStream();
- byte[] re = new byte[1];
- while (in.read(re) != -1) {
- result = result + new String(re);
- }
- in.close();
- } catch (IOException ex) {
- ex.printStackTrace();
- }catch(Exception e){
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement