开发者

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

  1. Idle (normal state when you phone is sitting idle no call dialed or received)
  2. offhook (when call is in
    dialing state or picked)
  3. 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜