Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically answer a call?

I want to answer a phone call. I found the intent android.intent.action.ANSWER but it seems that the only effect that I obtain is an ActivityNotFoundException. Why? Is it a deprecated intent? How can I achieve answer? I have also heard about the "telnet technique". What is that?

Thanks

like image 407
Matroska Avatar asked Apr 09 '10 20:04

Matroska


3 Answers

you can also send call keyevent to answer calls but the device needs to be rooted

answer calls :

try {
    Thread.sleep(800); 
    Process process = Runtime.getRuntime().exec(new String[]{ "su","-c","input keyevent 5"});
    process.waitFor();

}catch (Exception e) {
    e.printStackTrace();
}

End calls :

try {
    Thread.sleep(800); 
    Process process = Runtime.getRuntime().exec(new String[]{ "su","-c","input keyevent 6"});
    process.waitFor();

}catch (Exception e) {
    e.printStackTrace();
}
like image 73
Seifolahi Avatar answered Oct 23 '22 06:10

Seifolahi


It's not possible, check this thread for further information.

like image 4
systempuntoout Avatar answered Oct 23 '22 07:10

systempuntoout


It is possible to answer an Incoming Phone Call. Check this out : here

like image 3
Gautam Naroji Avatar answered Oct 23 '22 07:10

Gautam Naroji