RadioInfo.getNetworkType () returns 7

I call API, RadioInfo.getNetworkType (), it returns 7 and what kind of network is for 7?

I use GPRS in my phone. But 7 is not for GPRS.

Who knows which network type is for 7?

It's UMTS

Tags: BlackBerry Developers

Similar Questions

  • RadioInfo.getNumberOfPacketsSent () what WAF?

    Hello

    is RadioInfo.getNumberOfPacketsSent () return the total number of packets send independently during which WAF packets are send? Is it possible to get packets only for a specified WAF (e.g. WLAN)?

    Thank you!

    This method returns the number of packets sent on the WAFs.  There is no method which returns a count for a particular WAF.

  • I'm IOCancelledException?

    I'll send SMS to more than one number. And a problem with this exception.

    When it occurs?

    Please help me...

    Code is:

    ' Public Sub sendMessage (vector num, String message)
    {
    for (int f = 0; f)<>
    {
    String number = (String) num.elementAt (f);
                
    SendSMS sms = new SendSMS (number, message);
    System.out.println ("* START SMS *");
                
    System.out.println ("*" + number + "*");
    SMS. Start();
    }
    }

    SerializableAttribute public class SendSMS extends Thread {}
    MessageConnection conn = null;
    TextMessage text = null;
    The address of the string;
    String message;
        
    public SendSMS (String addr, String msg) {}
    Message = msg;
    address = addr;
                
    }
    public void run() {}
            
    try {}
                    
    Switch (getNetType ())
    {
                       
    case CDMA:
    Try
    {
    DatagramConnection connection = null;
    System.out.println ("BODY *" + message);
    ubyte bytes [] = message.getBytes ();           body.getBytes ();
    connection = Connector.open (DatagramConnection) ("sms: / /"+ address '); ("/ / +": 5000 ");
    Datagram in datagram = connection.newDatagram (bytes, bytes.length);
    Connection.Send (datagram);
    }
    catch (Exception e1)
    {
    System.out.println(E1+"---Datagram--SEMD--exception---");
    }
    break;
                                   
    IDEN-case: / / / break;
                       
    case GPRS:
    Try
    {
                                       
    String smsConnection = "sms: / /"+ address; " OPEN_STRING;
    MessageConnection smscon = (MessageConnection) Connector.open (smsConnection, Connector.READ_WRITE);
    TextMessage msg = (TextMessage) smscon.newMessage (MessageConnection.TEXT_MESSAGE);
    System.out.println ("BODY GPRS *" + message);
    msg.setPayloadText (message);
    smscon. Send (MSG);
    } catch (Exception e2) {}
    System.out.println(E2+"--sending---SMS---GPRS-exception---");
    }
    break;
                                        
    }
    }
    catch (Exception e) {}
    System.out.println ("Exception: Send Msg:" + e);
    }
    }
       
    }
    public final static int GPRS = 0;
    public final static int CDMA = 1;
    public final static int IDEN = 2;
       
    public static int getNetType()
    {
             
    If (RadioInfo.getNetworkType () == RadioInfo.NETWORK_GPRS)
    {
    return the GPRS;
    }
    Another yew (RadioInfo.getNetworkType () is RadioInfo.NETWORK_CDMA)
    {
    return of CDMA;
    }
    Another yew (RadioInfo.getNetworkType () is RadioInfo.NETWORK_IDEN)
    {
    return IDENTITY;
    }
               
    return the GPRS;
    }

    Use sms.run () instead of sms.start)

  • 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...

  • Problem to extract Rad_error_nocontent and CellLAC in the "BOLD" device - 9000

    Hello

    I am facing problem to extract Rad_error_nocontent and LAC through the BB Bold 9000. any program work fine with BB curve.

    Service Provider ATnT

    When I run the application in the BB Bold, he always returns to LAKE and Rad_error_nocontent = 0, is there a setting to BB "BOLD" that have to configure to pick up the Rad_error_nocontent and the LAKE?

    Paste the code for better understanding...

    CellInfo.java

    /***********************************************************************************************************************

    class CellInfo extends form {}
    private int Rad_error_nocontent;
    private int cellLAC;
    private motor eng;
    CellInfo (engine eng) {}
    This.ENG = eng;
    LabelField title = new LabelField ("CellTower", LabelField.ELLIPSIS |) LabelField.USE_ALL_WIDTH);
    setTitle (title);
    HorizontalFieldManager hfm1 = new HorizontalFieldManager (Field.FIELD_HCENTER);
    ButtonField photoButton = new ButtonField ("RAD_ERROR_NOCONTENT");
    photoButton.setChangeListener (new Showid());
    hfm1. Add (photoButton);
    Add (hfm1);
           
    }
         
    private class Showid implements FieldChangeListener
    {
    /**
    * Back to main camera screen.
    */
    ' Public Sub fieldChanged (field field, int context)
    {
    locateCellInfo();
    eng.showDialog ("Rad_error_nocontent" + Rad_error_nocontent + "cellLAC:" + cellLAC);
    }
    }
       
    public void locateCellInfo() {}
    {Switch (RadioInfo.getNetworkType ())}
    case RadioInfo.NETWORK_GPRS:
    Rad_error_nocontent = GPRSInfo.getCellInfo () .getCellId (); /*************Returning 0**************************/
    cellLAC = GPRSInfo.getCellInfo () .getLAC (); / * fetch 0 * /.
    break;
    case RadioInfo.NETWORK_CDMA:
    Rad_error_nocontent = CDMAInfo.getCellInfo () .getBID ();
    cellLAC = CDMAInfo.getCellInfo () .getNID ();
    break;
    by default:
    Rad_error_nocontent = 0;
    cellLAC = 0;
    }
    }
    }

    This code works fine with BB curve but fails with BB Bold

    Please help me to solve the problem...

    The problem may be that your case statement does not take into account NETWORK_UMTS (3g) to move you to your default.

  • WiFi ip address

    I'm trying to get my machine's ip address.

    the solution described in http://supportforums.blackberry.com/t5/Java-Development/wifi-IPAddress/m-p/277651#M46737 does not work for me (network current gprs, if I turn it off and use wifi only, I have a RadioException, impossible to obtain the APN).

    If I run RadioInfo.getNumberOfNetworks () I get 1, although it is connected using GPRS and Wifi. I can use the hotspot browser and have an IP on the wifi options.

    If I disable GPRS (always connected to wifi) RadioInfo.getNumberOfNetworks () returns 0.

    I guess I could open a server socket and use getLocalAddress(), but it is a bit much, isn't it?

    As you well pointed out, the best solution (it is based on a documented behavior) is to open a udp socket (or server TCP socket) via WiFi and question its IP address. Another hack is to get the ID of the AFN for the 'MagicRudyAPN.rim' using getAccessPointNumber, then its IP address using getIPAddress. MagicRudyAPN.rim seems to be a fake virtual/APN for access to / address of IP tunnel to the WiFi network.

    P.S. I'm tired to point out on this forum that radio network numbers/indices have nothing to do with AFN ID... All those who praised messages with 0, - 1, getNumberOfNetworks() + 1 because the solution are wrong - they only seem to work for some users because the number of open tunnels (identified by the ID of the AFN) is usually between 1 and 2, and the ID of the tunnels are quite often sequential. There may be a lot of tunnels open since a BlackBerry via different APNs. When a BlackBerry is enabled for a BlackBerry data plan, the first open tunnel is usually via the APN blackberry.net. Thus, for direct TCP tunnel is generally expected, if it is open to all, but this is not guaranteed because the device can open and close the other tunnels, such as WAP, for example... And even the blackberry.net tunnel should not be the first open tunnel.

  • UnsupportedOperationException in the CDMAInfo.getCellInfo () method

    Hello

    When we run the following device code (BB Bold, 4.6) generates the error "net.rim.device.api.system.UnsupportedOperationException."

    --------------------------------------------------------------------------------

    CDMAInfo.CDMACellInfo _CDMAInfo = CDMAInfo.getCellInfo ();

    int CDMABID = _CDMAInfo.getBID ();

    -------------------------------------------------------------------------------

    We are sure that we have a CDMA/UMTS coverage we are committed to CDMA/UMTS network.

    The same method with GPRSInfo.GetCellInfo () produces no error and works fine (but there are CDMA cellular settings)

    There someone know why the CDMACellInfo does not work?

    Please help ;-)

    Check if this is true:

    RadioInfo.getNetworkType() == RadioInfo.NETWORK_CDMA
    

    If this isn't the case, you are not on a CDMA network and the class CDMAInfo throw exceptions.

  • LAKE and Rad_error_nocontent problem of model 4.5.0.77

    Hello

    After have released an app with this code to get location area Code and withouth Rad_error_nocontent any problem with devices with os 4.3 or more, using:

    GPRSInfo.getCellInfo () .getLAC)

    GPRSInfo.getCellInfo () .getCellId)

    But in an operating system specific 4.5.0.77 crash when he tries to use that works. It says->

    Failure of the API (DE372) - BlackBerry Smartphone Simulator
    -----------------------------------------------------
    Called an API not supported: RadioGetCellInfo

    Anyone know if this is a bug, or someone knows how to get Lake and Rad_error_nocontent Info?

    Thank you very much in advance.

    Kind regards.

    Hello world

    I know what happened, it was because of the CDMA connectivity. I fixed that with a simple switch:

    switch (RadioInfo.getNetworkType ())
    {
    case RadioInfo.NETWORK_CDMA:
    //....
    break;
    case RadioInfo.NETWORK_GPRS:
    //...
    break;

    }

    Thank you

  • Network method available!

    Hi guys I want to check the connection of the device is crucyeye or not.

    example:

    Boolean networkAvailable =?
    If (! networkAvailable) {}
    Dialog.Alert(constants.) ALERT_NETWORK_DOWN);

    Thank you!!!

    You can check if you're "on the cover" like this:

    public synchronized boolean isWirelessActive()
    {
    If (net.rim.device.api.system.RadioInfo.getState () == net.rim.device.api.system.RadioInfo.STATE_ON &)
    net.rim.device.api.system.RadioInfo.getSignalLevel ()! = net.rim.device.api.system.RadioInfo.LEVEL_NO_COVERAGE)
    Returns true;
    on the other
    Returns false;
    }

  • SMS is not sent

    Hello

    I need your help too I write an app that sends SMS, but for CDMA as Verizon, it does not work. I wrote below the code for CDMA, forGSM MessageConnection works very well but for CDMA MessageConnection is not working do not so I tried to use DatagramConnection, but still does not. I searched the forum and got a thread, but it was marked as resolved, but below the code works is not for me. RIM need to explain the problem. Can someone help me sort the Please this problem.   Please, I beg you. Please, I beg you. It is also urgent for me.

    My Code for CDMA which does not at all do exception. :::

    If (RadioInfo.getNetworkType () == RadioInfo.NETWORK_CDMA) {}
    DatagramConnection connection = null;
    try {}
    ubyte bytes [] = mesg.getBytes ();
    connection = Connector.open("sms://") (DatagramConnection); "
    Datagram datagram = connection.newDatagram (connection.getMaximumLength ());
    datagram.setData (bytes, 0, bytes.length);
    datagram.setAddress (_appOpData.getPhno ());
    Connection.Send (Datagram);
    } catch (Exception t) {}

    } {Finally
    try {}
    Connection.Close;
    } catch (IOException e) {}
    Generative TODO catch block
    e.printStackTrace ();
    }
    }
    }

    use Connector.open("sms://"+_appOpData.getPhno());)

  • Isn't strange?

    Hi friends,

    look at my next code

    I m using this code to check if the internet connection is present or not (I do this check before showing mail composition window)

    int status = RadioInfo.getState();
    
    if ( status == RadioInfo.STATE_OFF
    || status == RadioInfo.STATE_SERVICE_REQUIRED
    || status == RadioInfo.STATE_TURNING_OFF
    || status == RadioInfo.NETWORK_NONE )
    
        return false;
    else
        return true;
    

    Here, I got 'true' if I run it on emmulator...

    it it so or should I look for all the configurations on emmulator?

    solved!

    I just used the static method RadioInfo.isDataServiceOperational () to chk service...

  • CoverageInfo.isCoverageSufficient (CoverageInfo.COVERAGE_MDS) always returns false on Simulator

    Hello world

    In my application, I would like to send data on a certain interval using the BES (MDS).  When the Blackberry is on the cover, I send the data right away... but when the Blackberry is out of coverage, I'm storing data on the PersistentStore and send it to the next interval.

    This is the condition that I use to determine whether or not the Blackberry is on the cover:

    {If ((RadioInfo.getState ()! = RadioInfo.STATE_OFF & (RadioInfo.getNetworkService () & RadioInfo.NETWORK_SERVICE_DATA)! = 0) & {CoverageInfo.isCoverageSufficient (CoverageInfo.COVERAGE_MDS))}

    It works perfectly on a real device Blackberry... but it always returns false on the Simulator (I tried Curve 8310 Rogers and 8330 Curve with my code point 4.2.1).)  It seems to be this specific line which is not correct:

    CoverageInfo.isCoverageSufficient (CoverageInfo.COVERAGE_MDS)

    It is not a very big problem because it works on a real device... it's just development and debugging more complicated as I have to remember to put this line in the comments when you use the Simulator and remove the comments before installing the application on a real device.

    I have to do something special on the Simulator to enable this?  Or is it a problem with my code?

    Thanks for your help!

    I saw that too. Put the CoverageInfo into your own method and use DeviceInfo.isSimulator () to work around the call and returns "true" If you run on the simultor.

  • CoverageInfo.getCoverageStatus () return codes.

    Test app with OS 4.2.1-> 4.7 on the 9xxx 83xx and 88xx models

    How can I find a list of the return codes for the COVERAGE_MDS | COVERAGE_DIRECT | Constant COVERAGE_NONE in CoverageInfo?

    Read the posts only I found related to this, Mark and Richard mentioned tips, but nothing about the codes that are returned.

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=3336&query.ID=307...

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=13959&query.ID=30...

    This line of code:

    mds_num = CoverageInfo.getCoverageStatus(CoverageInfo.COVERAGE_MDS,false);
    

    I get:

    7 if the device is turned on on BES

    5 if it is not connected to a BES, but he has a data plan with the carrier

    0 using 8800 by MDS Simulator Simulator.

    I'm looking to complete a login code.

    Anyone know the rest of the codes I have to deal with?

    In addition, in the first thread that precedes it is stated that the call to getCoverageStatus with and without params returns different results.

    I think that it is because he calls without a WAF stated simply back the more optimistic code? Which means that if one of the WAFs is on the cover, it returns 7? The list of codes would help for debugging, I think.

    Thank you.

    kkraliz,

    You call the method with wrong arguments. You are passing COVERAGE_MDS as the first paramether, whereas the method expects one of the RadioInfo.WAF_* values.

    I think that you test this on a CDMA phone and values WAF_CDMA == COVERAGE_MDS. If you get the expected results.

    The return values will be the combination of the CoverageInfo.COVERAGE_* values.

    Then

    0 - No Coveage
    5 - COVERAGE_BIS | COVERAGE_CARRIER  ( 4 | 1)
    7 - COVERAGE_BIS | COVERAGE_MDS | COVERAGE_CARRIER ( 4 | 2 | 1)
    
  • Sierra is a bomb, need help to return to El Capitan

    Could someone more at Apple just try it once to make sure that the "new and improved" operating systems actually work before releasing? With all the money goes to Cupertino, there is no money to hire testers rather than rely on Mac users? Talk about Stockholm syndrome. I'll cut to the Chase, now my computer has been upgraded to Sierra without my knowledge, and several apps are now, not to mention that I can't access my company's server today. How to return to El Capitan - can I save all my work from today and use Time Machine to restore my machine? If this isn't the case, should I really erase everything and start from scratch? Someone please stop me to jump on a ledge, I have work I need to pass on to customers. Any suggestions, help, you can give would be appreciated. Carl

    Restore your backup, and if you do not upgrade your Mac, who did? Maybe you should tell them not to do the without you knowledge or approval.

  • How can I uninstall Sierra &amp; return to El Capitan without an external hard drive or equivalent required by the instructions online?

    How can I uninstall Sierra & return to El Capitan without an external hard drive or equivalent required by the instructions online? I find too many misadventures and not happy.

    Hello

    Check out this useful tutorial: https://www.igeeksblog.com/how-to-downgrade-macos-sierra-to-mac-os-x-el-capitan/

Maybe you are looking for