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

Java Development

Reply
New Developer
Posts: 59
Registered: ‎03-10-2009
My Device: Not Specified
Accepted Solution

How to test weather device is in roaming or not?

Hi, we have an requriement that we need to check weather the device is in roaming or not using RIM api.

so any body can please help me in this, which piece of code will work to know weather device is in roaming or not using RIM api? 

Highlighted
Developer
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: How to test weather device is in roaming or not?

Hi,

 

Have a look at this class net.rim.device.api.system.RadioInfo

 

there is one property NETWORK_SERVICE_ROAMING may be this will help you.

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
New Developer
Posts: 59
Registered: ‎03-10-2009
My Device: Not Specified

Re: How to test weather device is in roaming or not?

Hi, Thank you very much for your reply.

 

using that api when i'm trying to print, its printin value 8. so how do i'll come to know weather the device is in roaming or not and what i have to do when with that value 8?

 

Please let me know some piece of code so that will come to know weather the device is in roaming or not, as i'm very new to this RIM api.

 

Ex:

 

System.out.println(net.rim.device.api.system.RadioInfo. NETWORK_SERVICE_ROAMING);

 

prints 8

Developer
Posts: 166
Registered: ‎05-07-2009
My Device: Not Specified

Re: How to test weather device is in roaming or not?

You have to check bitmask returned by RadioInfo.getState(). For example this way:

 

boolean isRoaming = (0 != (RadioInfo.getState() & RadioInfo.NETWORK_SERVICE_ROAMING));

By the way, pay attenation that there are NETWORK_SERVICE_ROAMING and NETWORK_SERVICE_ROAMING_OFF_CAMPUS. I don't know what is the difference and whether either of them is what you need. All I know is the way how to check bit flag.


--------------------------------------------------------------------------------------------------------
If your issue is solved, set "Solution" mark at the relevant post.
Don't hesitate to Kudos people whose posts helped you.