set the MCC, MNC. Different API

Hey there,

So far, I've found there are two ways to determine the MCC and MNC values:

  1. Via RadioInfo.getMCC (); RadioInfo.getMNC (); (see this )
  2. using the value of the IMSI. for example (Details)
     private static int getMCCFromIMSI( byte [] imsi ) {
          if( imsi == null || imsi.length < 3 ) {
             return -1;
          }
    
          // the first three bytes of the IMSI string represents the country code
          int mcc = 0;
          for( int i = 0; i < 3; ++i ) {
             mcc *= 10;
             mcc += imsi[i];
          }
    
          String mccString = "" + mcc;
          int mccAsDecimal = Integer.parseInt(mccString, 16);
    
          return mccAsDecimal;
       }
    
       private static byte [] getIMSI() {
          try {
    
             if (RadioInfo.getNetworkType() == RadioInfo.NETWORK_CDMA) {
    
                return CDMAInfo.getIMSI();
    
             } else {
    
                return SIMCardInfo.getIMSI();
             }
    
          } catch (Exception e) {
          }
          return null;
       }
    

    Is there any particular differenc between these two ways? Wish, according to different types of mobile network (CDMA, GSM...)

    Thank you

Looks like RadioInfo.getMCC works very well both the GSM and CDMA network. BUT there is a bug in os4.7, when the wrong values are returned. http://supportforums.BlackBerry.com/T5/Java-development/finding-network-MCC-for-CDMA-devices/m-p/501...

Tags: BlackBerry Developers

Similar Questions

  • How do I set the power for different time?

    Hello everyone,

    I try to set the different value of RF power for different time as shown in the figure. To do this, I tried using the timer 'Elapsed time '. A counter that counts each time is an array index, as shown in the attached VI. But, the meter does not not.  I didn't know what went wrong. would you lelp me please?

    I thank very you much.

    I would like it.

  • OSB - how to set the mask of different file for the FTP traffic?

    Hi all

    I use transport FTP OSB to watch a folder (on remote FTP server).
    For file mask, we can use several types?

    In my case, I want to ask all the files that has the choice of the following file name extension:
    1 *. ABC
    2 *. ABc
    3 *. AbC
    4 *. ABC
    5 *.abc
    6 *.aBc
    7 *.abC
    8 *.aBC

    In other words, any file ends with abc (case doesn't matter).

    Can I set different types of file mask? How?
    I tried to put all 8 masks, separated by ',' and also tried ';
    But failed.

    Or any expression , can I use the file mask?

    I tried to put all 8 masks, separated by ',' and also tried '; But failed.

    A proxy may have only one mask file. You cannot specify more than one file in a single service mask.

    Can I set different types of file mask? How?

    Not in a single proxy service. You must either create a proxy with file mask *. * (star.star) to read all the files in the directory, or you must create the number of proxies with each having a specific file mask.

    Or any expression, can I use the file mask?

    Only the wildcard characters * and? are allowed in the file mask. Regular expressions are not supported.

    Can you let us know more about your use case so that we suggest a good solution? Will be your files with another extension of file system process differently or what all the file extension is treated in the same way? Which application writes files being read by OSB and cann't, it controls the naming of files?

    Kind regards
    Anuj

  • How to set the url for different environments such as DEV, PROD etc using the file resources in SSRS. How we determine the environment?

    While working with SSRS reports, I would like to store the URL once in a variable environment level and have all read reports from there. How this could be done. I think that by adding the resource file, that this might work. But how do we identify which URL should be invoked in varied such as DEV, TEST, PROD environments?

    Hello

    Your question of Windows 7 is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the public on the TechNet site. Please post your question in the following link for assistance:
    http://social.technet.Microsoft.com/forums/en/smallbusinessserver/

    I hope this helps!

  • Unable to set the password in Active Directory 2008 R2 group policy

    We are trying to create a group policy that renames the built-in to our servers administrator account and change the password.  The strange thing is that when we create this Group Policy Computer Configuration > preferences > Control Panel Settings > local users and groups, the password section is grayed out.  We have a test domain, and this isn't a problem here.

    We tried to set the password with different accounts (domain administrator and other members of the Domain Admins group) and different machines (directly on my workstation and domain controller).  Here is a screenshot of what we see.  Any help would be greatly appreciated!

    I found the cause in MS14-025.

  • How to set the display in order to run the installation program

    Hello

    Could you please explain how to set the Display variable I connect via the VNC client directly to windows X Linux (Gnome)
    in order to run the installer to install R12 EBS?


    I guess that since the connection is by VNC client, so I just need to open a terminal window and start the Installation...



    Thanks and greetings
    MZ

    Srini Chavali wrote:
    The DISPLAY variable must be set to the IP address of the client.

    Not necessarily - it is meaningless to set the DISPLAY of different client IP addresses if you want to run the installation program (or any GUI) on the server of different customers.

    Thank you
    Hussein

  • LR4.1 - tone curve - how to set the individual RGB channels?

    Hello

    I can't find out how to set the curve of different RGB channels.  I guess the LR4 tone curve works as the dialog box curves PS with the channel drop-down list.

    LR4.1 help says:

    To make adjustments at different points on the tone curve, choose an option in the menu of the curve of points, click the button change the curve of points , and then do one of the following:

    • Choose an option from the popup menu of the channel. You can change the three channels at once, or choose to change the red, green, or blue channel individually.

    When I click on the small icon in the lower right corner of the Panel curve tones, the Panel shrinks while I do not see the sliders of regions.  If I click again, they are visible again.  I can't find where to select one of the three channels indvidual.

    Aid refers to the "Point curve menu."  Where is the menu Point curve?  The curve of points is different from the tone curve?

    If I right-click (Windows) in the curve dialog box, the shortcut menu has an option show information.  I click on it power and don't see any change or any info.  Where should I look for info?

    Thanks for any help here.

    John


    Hi John,.

    The curve of points is without cursors. The settings for the individual channels are only available with

    PV2012. You must be editing a file with PV2010 or 2003. When to PV2012, you will see "channels: RGB" under the window of the curve. Click on the triangles of doule following RGB

    for each channel.

    HTH

    Rich

  • Sleep Timer Pavillion DV 7 - How do you set the timer for a different time setting?

    Sleep Timer Pavillion DV 7 - How do you set the timer for a different time setting?

    Hello Pidcock,

    Welcome to the HP Forums, I hope you enjoy your experience! To help you get the most out of the Forums of HP, I would like to draw your attention to the Guide of the Forums HP first time here? Learn how to publish and more.

    I understand that you want to change on your computer sleep timer. I'll be happy to answer that question for you. Now you have not specified what operating system you are using, so I guess it's the same operating system provided with your computer (Windows 7). I will provide you the HP support document: Management of power (Windows 7 and Vista) Options, which will guide you in how to set the power of your laptop. Just in case you have upgraded to Windows 8 I am also including the HP Support document: Manage the power (Windows 8) Options. This document will guide you through the same steps in Windows 8.

    I hope that I have answered your question to your satisfaction. Thanks for posting this question on the Forums of HP. Have a great day!

  • You can set the password to the screen saver different password that the password system on Windows 7

    I want to set the password for the screen saver to something else that the network password that I use. Is this possible in Windows 7?

    It is not possible. When the screensaver starts and then interrupted, the login screen appears. Then, of course, it cannot be a different password.

  • How get/set the value of the DataObject object in the task of the API?

    How get/set the value of the DataObject object in the task of the API?

    Are there examples of code availible?

    Hello

    You are here: http://docs.oracle.com/cd/E23943_01/dev.1111/e10224/bp_worklistcust.htm

    Antonis

  • Set the signature using the API field only

    I have a situation where all PDFs you signed are created for each customer individually and on the fly.

    I must be able to define the scope of the signature using the API only.

    Is this possible? I can't change the pdf file and add any kind of labels. It must be done using an x, the value of the coordinate y.

    Hello Lawrence,.

    If you are looking to set the fields of the form through the API, you can see below reference material:

    https://secure.NA1.echosign.com/public/docs/EchoSignDocumentService21#FormField

    Kind regards

    -Usman

  • How to set the time to preview using the REST Api of the assembler

    Hi all

    Using the REST API of the assembler, I can't feature "set the time to preview" to trigger a specific model that fires only at a specific time

    This is the format that I'm trying:

    http://xxxx:8006 / assembler/json/pages/home? Endeca_Time = 2020-04 - 05 T 14:30

    I use the correct format? This is the url parameter listed in the documentation of the Assembly

    Thank you

    It turns out that the documentation is wrong

    1. In assembler.properties (service\WEB-INF) of your REST API, you must define

      1. User.State.Ref = previewUserState
    2. You use Endeca_date and not Endeca_Time in the URL (documentation is wrong)
    3. Coding varies from a browser (you may need to URL encode the date in Firefox)

    Example:

    http://xxxx:8006 / assembler/json/pages/home? Endeca_date = 2020-01 - 11 T 18:00

    The date format is: YYYY-MM-dd' you HH: mm

  • How to set the different HTML (site) page in the workspace during the backup?

    Hello
    How to set the different HTML (site) page in the workspace during the backup?

    For example:
    A user connects to the workspace.
    If you have already started the procedure for backup database administrators, the user sees the HTML page that reads "don't touch anything, need a backup procedure.

    Thank you to
    Marek

    Hi Marek,

    I have not tried, but it seems the most logical way:

    Rename the BpmLauncher.jsp to BpmLauncher.jsp.orig

    Then, create a new file called BpmLauncher.jsp and put the following inside:

    
    

    Do not touch anything, it takes a backup procedure

    Kind regards
    Robb Salzmann

  • PL/SQL API to set the text for the notification

    Hello

    Anyone can indicate APEX PL/SQL API to set the value of notification page text?

    I found call WWV_FLOW.show_error_message which display the error message, but doesn't seem that she also transaction Rollback - so I need to have something similar for notifications. Directly manipulate WWV_FLOW.g_notification works not as well - I had invalid checksum error.

    Any ideas will be appreciated.

    Sincerely
    Husbands

    Sentinel page is too early in the treatment of set this global but you should be able to use before header process, or at any other point in shooting to set. What is an API, it is not a because a simple assignment to the global level will be sufficient.

    Scott

  • WebCenter Sites REST API: How to set the active model?

    How can I set the model for the asset, I create.

    AssetBean sourceAsset = new AssetBean();

    sourceAsset.setName (value);

    sourceAsset.setName (prod_name);

    sourceAsset.setCreatedby (value);

    sourceAsset.setStatus (value);

    sourceAsset.setSubtype (value);

    ...

    but no set model?

    Hello

    The model on an asset is defined as an attribute:

    List attributes = sourceAsset.getAttributes()
    for(Attribute attribute: attributes) {
        if(attribute.getName().equals("template")) {
            attribute.getData().setStringValue("ArticleLayout2");
        }
    }
    

    or if you create a new item of assets:

    List attributes = sourceAsset.getAttributes()
    Attribute templateAttribute = new Attribute();
    templateAttribute.setName("template");
    templateAttribute.setData(new Data());
    templateAttribute.getData().setStringValue("ArticleLayout2");
    attributes.add(a);
    

    Kind regards

    Stephan.

Maybe you are looking for

  • No Service, iPhone 7 more from AT &amp; T

    Just the iPhone Plus 7 and it worked fine for a bout 4-5 days. Then, I used Google Maps yesterday to go to a ball game. After using Google Maps, my cell service has been abandoned and continue to see 'No. Service' on my iPhone 7 more (on AT & T in th

  • Mail is unable to respond to an email when Safari is open (El Capitan)

    I have found a curious bug with El Capitan.  If the Mail and Safari are open and I try to reply to an email, I get a blank e-mail response window which is not active - which means that I can't type anything on this window and I can't close it either.

  • Why an MP3 would not be able to load in the cloud?

    I got game and a few times recently an MP3 of a song created from a Youtube video is not accepted in the cloud in iTunes. I have the icon of the barred dustbin cloud. No idea why?

  • Encounterd problem installing TweetDeck...

    Had trouble with TweetDeck... Uninstalled and then tried to reinstall. Keep receiving a message that it was unable to install the C:/program files, as it was already a program with the same name... (and yet I don't see it in the list of programs)...

  • Compatible with SR224G GBIC

    Hello Very quick question! Anyone know if I can use a Cisco GBIC (p/n 30-1301-02) in SR224G? See you soon,. Huw