简体   繁体   中英

Is there a way to detect incoming toll calls from Android?

Well, I'm gonna try to explain what's my problem. Here in Brazil we can make a normal call and the recieving person will pay for it. I mean, A calls to B, then if B picks the phone, then he pays and not the one who called to him.
When A calls to B in this way he must prefix a number before the B's real number. I mean, if B's phone number is 55555555, then A needs to call him like this: 909055555555.

When i check it in incoming calls, it appears only as normal number of A without any information about it. Does anyone know how to detect this kind of call?

Try this link

http://www.krvarma.com/2010/08/detecting-incoming-and-outgoing-calls-in-android/

Essentially, you register for the android.intent.action.PHONE_STATE intent and check for the extra on the intent for EXTRA_INCOMING_NUMBER to get who is dialing you. (your java code and then look at the number and do any decision making.)

The link notes that

TelephonyManager.EXTRA_INCOMING_NUMBER. This variable contains the incoming phone number. Note that this variable will not be present when the state is not TelephonyManager.EXTRA_STATE_RINGING.

I assume that the user need to pick up the call for your application detect the number, which may be a deal-braker for you.

UPDATE

I understand your question better now. It seems like the transformation to the real number from 9090* number is done by your cellular operator. I don't think you have a way to detect it, because your phone doesn't see a difference between the two calls. It sees them as the same caller. You may have a better answer if you talk to your cellular operator.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM