views:

43

answers:

2

Hello everyone, in my app I should do some action when a call comes but not answered by the user.

I have searched in the android.telephony and the NotificationManager, but I haven't found a method to solve this problem.

Does someone have an idea of how to get to know if there is a missed call on the phone or not ?

Thanks in advance for your help.

A: 

From what I understand, you need to query the CallLog provider (or maybe CallLog.Calls), and this page explains how to query content provider: http://developer.android.com/guide/topics/providers/content-providers.html#basics

I'd be happy to see the code if you can make this work !

GôTô
Yes. But in that case, I will not be able to know if the missed phone call is answered or not. In my app, if the missed phone has been answered, I should not notify the user about the missed phone call again.
Mathieu
How can a missed call be answered? There is a MISSING_TYPE constant in the CallLog.Calls class, I believe a call is either of MISSING_TYPE, INCOMING_TYPE or OUTGOING_TYPE
GôTô
Yes. I am sorry that I didn't express what I want clearly. I agree with you that "a missed call" can't be answered when the phone is "ringing". But we can call back when we know there is a missed call after, and this is what I mean "answer" in my question. So in this way, I think it is better to use a notification other than reading the info in the calllog. I hope I am clearer this time.
Mathieu
A: 

I suppose you have content providers to access call logs.

http://www.anddev.org/video-tut_-_querying_and_displaying_the_calllog-t169.html

http://www.devx.com/wireless/Article/41133

If this code works you just need to run this query at the right time. I mean check some samples that can notify you when you get a call in your device

http://groups.google.com/group/android-developers/browse_thread/thread/d97a759a3708cbe3

Once you get this notification put a timer or use some built in Intents to find that the phone is back to normal state and access the call logs...

Possible duplicate

http://stackoverflow.com/questions/3665183/broadcast-receiver-for-missed-call-in-android

http://stackoverflow.com/questions/3667029/show-toast-on-missed-call-in-android-application

Rahul