Search This Blog

Saturday, 15 December 2012

How to get the call details from PhoneListener

So here is the one how to get the call details and send it to somewhere on remote database.


As i mentioned earlier how to integrate PhoneListener:

here are the functions to over ride in Phone Listener , you may override any function as the name suggests when these functions will be called...
Create these variables in class:
PhoneCall _phoneCall;
String _phoneNumber;
int _callduration;

first add your phone listener:


ii  am getting call details when the call is incoming....

_phoneCall = Phone.getCall(CallID);
    _phoneNumber = _phoneCall.getDisplayPhoneNumber();

Now as you can see i am just getting the details here nothing else;

in CallDisconnected function:
_callDuration = _phoneCall.getElapsedTime();
//Call function to send data to server.....use invokeLater for this ...


No comments:

Post a Comment