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

Java Development

Posts: 13
Registered: ‎08-26-2010
My Device: Not Specified

Roaming status not shown properly



I am using RadioInfo API to find the roaming status of the device.


The code snippet,


String roamingStatus = "";


if(RadioInfo.getNetworkService() == RadioInfo.NETWORK_SERVICE_ROAMING)

      roamingStatus = "Roaming";


      roamingStatus = "Home Netwok";


But, I am getting the roamingstatus as Home Network when the device is in roaming.


Did I mistake anything in my code?


How could I find the roaming status?


Please help me!!







Posts: 70
Registered: ‎11-24-2009
My Device: Not Specified

Re: Roaming status not shown properly

Try using the flag with bitwise anding



 final int networkService = RadioInfo.getNetworkService();
        final boolean isRoaming =  
            (0 != (networkServiceState & RadioInfo.NETWORK_SERVICE_ROAMING));
        final boolean isRoamingOffCampus = 
            (0 != (networkServiceState & RadioInfo.NETWORK_SERVICE_ROAMING_OFF_CAMPUS));
        return (isRoaming || isRoamingOffCampus);



Mark kudos if this helps Smiley Happy

New Contributor
Posts: 3
Registered: ‎03-14-2013
My Device: BBY 9860
My Carrier: Meteor

Re: Roaming status not shown properly

just a small change to your variable name in the first line is all. Smiley Happy