Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What info can I get during a phone call using the Android API?

Could I get MCC & MNC of the other party, either on an incoming or an outgoing call?

I am aware that you can get your own information from the SIM card but I am interested for the information of my contacts.

I guess I must be able to retrieve such information during a phone call.

So two main questions:
Is it allowed from the protocol?

Are there any classes inside Android API that provide such information? (looked up inside TelephonyManager but did not find any)

like image 419
George Pligoropoulos Avatar asked Nov 14 '13 16:11

George Pligoropoulos


2 Answers

Like payeli has answered: No, you cannot.

Firstly, because there is no API for accessing the other party's cellular information. Secondly, because Android doesn't actually know. You can delve into the source code of the TelephonyManager, and you'll see that it only contains information about the local telephony provider.

Furthermore, the internal Android class Connection also shows no hint of any such information. (Regardless of the information it contains, it isn't accessible from the API, not even via reflection.)

That being said, there are currently services that provide some insight into phone numbers. Here in the Netherlands, KPN provides an API for looking up caller information, including the current coverage state of the phone, whether it's roaming or not, and other details. I'm not sure if the API is public yet or not, but perhaps there's a similar service available in your region.

like image 130
Paul Lammertsma Avatar answered Sep 20 '22 12:09

Paul Lammertsma


No, you can only retrieve the MCC and MNC of your phone, not for third party numbers to which you make or recieve calls.

Reason: Calls target a phone number, not the MCC/MNC of the sending/receiving devices. The MCC / MNC tuple is used to uniquely identify a mobile phone operator/carrier, so if user is using carrierX at present, he will have one value of MCC/MNC, and if user changes mobile carrier/operator but retains same phone number, the the value of MCC/MNC will change but phone-number will still be constant.

So the mapping between phone number of a contact and MCC/MNC of their carrier are not fixed. So:

Could I get MCC & MNC of the other party, either on an incoming or an outgoing call? NO

like image 27
Infinite Recursion Avatar answered Sep 20 '22 12:09

Infinite Recursion