I am new to android.
I am implementing one application related to incoming and outgoing call details.
I am getting outgoing call and incoming call details by usi
Continuously check when device state is changed from CALL_STATE_IDLE, to CALL_STATEOFFHOOK... It gives the exact time of your call being answered
Try using a TelephonyManager
if ((intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL) || (intent
.getAction()
.equals(TelephonyManager.ACTION_PHONE_STATE_CHANGED)))) {
String phoneState = intent.getExtras().getString(
TelephonyManager.EXTRA_STATE);
if (intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL)) {
Log.d(TAG, "Outgoing call");
if (TelephonyManager.EXTRA_STATE_OFFHOOK.equals(phoneState)) {
Log.d(TAG, "Incoming call/Outgng call Started");
}
if (TelephonyManager.EXTRA_STATE_IDLE.equals(phoneState)) {
Log.d(TAG,"Call ended");
}
if (TelephonyManager.EXTRA_STATE_RINGING.equals(phoneState)) {
Log.d(TAG,"Call ringing");
}
}