Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Development

Reply
New Contributor
Posts: 3
Registered: ‎09-05-2013
My Device: BB Z10
My Carrier: Cyta
Accepted Solution

Please help - Urgent need to read MCC.

First of all hello.

 

I am developing a dialer application for the telecommunications company I work for, to easilly allow our users to call through our network (we sell calling cards and telephony through a carrier selection number which has to be dialed prior to the destination). The problem is that I am in need to read the MCC code from the telephony network the user is currently registered so that I can detect if he\she is on roaming, and what country the user is currently in so as to call the correct number to reach our switch and route correctly, but also to charge correctly.

 

I tried to use TelephonyManager's getNetworkOperator(), but this returns an empty string. I have also tried other methods to get the country (all from TelephonyManager), to no avail.

 

If anyone can help, I would be VERY grateful.

 

Kind regards,

 

SK

Trusted Contributor
Posts: 160
Registered: ‎11-17-2010
My Device: PlayBook, Z10, Q10

Re: Please help - Urgent need to read MCC.

Hi,

 

Welcome on the forum!

 

At this moment I can't test it, but on Android devices there is another method to get mcc and mnc info.

From your Activity you may try the following calls:

getResources().getConfiguration().mcc

getResources().getConfiguration().mnc

--
If you find this post useful please Like it.
If it solves your problem please mark as solution.
New Contributor
Posts: 3
Registered: ‎09-05-2013
My Device: BB Z10
My Carrier: Cyta

Re: Please help - Urgent need to read MCC.

Currently I am unable to check, but this is on the top of my TODO list. I will check it and report back tomorrow morning. I just want to verify: this will recieve the cell network MCC and not the SIM MCC, right?

 

Thank you very much,

 

SK

Trusted Contributor
Posts: 160
Registered: ‎11-17-2010
My Device: PlayBook, Z10, Q10

Re: Please help - Urgent need to read MCC.

Well, based on the Android reference the configuration fields mcc, and mnc indicate the current mobile country code and mobile network code, respectively, so it should not be the SIM card data. Anyway, it needs to be tested to make sure.

 

--
If you find this post useful please Like it.
If it solves your problem please mark as solution.
Highlighted
New Contributor
Posts: 3
Registered: ‎09-05-2013
My Device: BB Z10
My Carrier: Cyta

Re: Please help - Urgent need to read MCC.

I was just able to check this on an actual device and I can confirm that it works as advertised.

Thank you very much.