这是可能获得通话过程中拨出电话时长?这是、时长、过程中、拨出

2023-09-12 10:05:12 作者:酒酿樱桃子

我会得到呼出通话时间打电话,我还以为得到时persone到另一边接听我的电话,但PhoneStateListener我们可以得到一个呼叫的状态,但PhoneStateListener改变状态到CALL_STATE_OFFHOOK呼出时立即开始,而不是当人到对方的答案,所以我不能让通话的有效时间在通话过程中。 任何想法要做到这一点

i would get outgoing call duration a call, I thought to get when the persone to the other side answer my call, but with PhoneStateListener we can get the state of a call, but PhoneStateListener changes state to CALL_STATE_OFFHOOK immediately when the outgoing call starts and not when the person to other side answers, so i can't get the effective time of call during a conversation. Any ideas to do this

在此先感谢!

推荐答案

我认为这是可能简单地通过刺探通话记录。您可以在通话结束查询通话记录和持续时间字段会告诉你想知道的东西。

I think this is possible simply by spying on the call log. You can query the call log at the end of a call and the duration field will tell you what you want to know.

下面是一个不错的教程。只是字段CallLog.Calls.DURATION添加到阵列。

Here's a nice tutorial. Just add the field CallLog.Calls.DURATION to the array.

的http://www.dcpagesapps.com/developer-resources/android/25-android-tutorial-call-logs

我希望这有助于。

灵光