Adobe air for android,question about the phone call
How to access the phone call history,
a开发者_开发知识库nd is it possible to do some action before I answer the phone call. What I am trying to do is when I got a phone call, before I answer it, I wanna it to check the my contacts saved in the server.This is for accessing phone call history
Uri allCalls = Uri.parse("content://call_log/calls");
c = managedQuery(allCalls, null, null, null, null);
String num= c.getString(c.getColumnIndex(CallLog.Calls.NUMBER));// for number
String name= c.getString(c.getColumnIndex(CallLog.Calls.CACHED_NAME));// for name
String duration = c.getString(c.getColumnIndex(CallLog.Calls.DURATION));// for duration
int type = Integer.parseInt(c.getString(c.getColumnIndex(CallLog.Calls.TYPE)));// for call type, Incoming or out going
And as per my knowledge you cannot do any actions or you cannot guess that your call is picked up or not because android provides only 3 call states
- Idle (normal state when you phone is sitting idle no call dialed or received)
- offhook (when call is in
dialing state or picked) - Ringing (When there is an incoming call is received picked up)
So there is no way to to know that the call is picked up or ringing or in dialing state or in hold state
Thankyou
精彩评论