Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
493 views
in Technique[技术] by (71.8m points)

android - Outgoing call status

My Query is, I want to get notified if the receiver at the other side picks my call when I am making an outgoing call. Is it possible with the Android SDK.

The onCallStateChanged Function is called only when the Person dial a number(OFFHOOK), from his phone and When the call reciever person disconnects the call(IDLE), but there is no State parameter to knowthat, does the other end person has recieved the call?

public class MyPhoneStateListener extends PhoneStateListener{

    public void onCallStateChanged(int state,String incomingNumber){
        Log.d("Checking---->",TelephonyManager.ACTION_PHONE_STATE_CHANGED);
    }
}

Logcat give only the following information when call recieved at the other side:

01-19 19:33:30.633: DEBUG/CallNotifier(638): stopRing()... (OFFHOOK state)
01-19 19:33:30.662: DEBUG/Ringer(638): stopRing()...
01-19 19:33:30.694: DEBUG/Ringer(638): - stopRing: null mRingHandler!
01-19 19:33:31.256: DEBUG/PhoneApp(638): updateWakeState: callscreen true, dialer false, speaker false...
01-19 19:33:31.287: DEBUG/PhoneApp(638): updateWakeState: keepScreenOn = false (isRinging false, showingDisc false)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I'm having the same problem. I use PhoneStateListener for incoming calls, it works well. But for outgoing calls I was only able to register a BroadcastReceiver to the intent android.intent.action.NEW_OUTGOING_CALL.

In my knowledge there is no way to determine weather the other side has picked up, or not. However you can use CallLog to retrieve call information offline. Detailed call state events are only available through the internal class com.android.internal.telephony.Phone which you won't have access to unless you compile your own Andoid.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...