B
B
bezbunix2014-01-16 03:06:37
Android
bezbunix, 2014-01-16 03:06:37

How to detect start of Android conversation programmatically?

Good day.
You need to get the status of the call in the Android application, like "Picked up the phone".
When the person on the wire accepts the call and the conversation starts.
CALL_STATE_OFFHOOK helps to understand that the call has started, but something more precise is needed.
I call the call myself programmatically:

Intent myIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + number));
        myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(myIntent);

Thanks in advance for your replies.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
constv, 2014-01-17
@bezbunix

One option is to read the logs

...
Process logcatProc = Runtime.getRuntime().exec("adb logcat -v time -b radio GSM:D *:S");
BufferedReader mReader = new BufferedReader(new InputStreamReader(logcatProc.getInputStream()), 1024);
...

spied in the sources com.android.internal.telephony.gsm.GSMConnection

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question