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
Regular Contributor
Aditi
Posts: 69
Registered: ‎10-11-2010
My Device: Not Specified

How to detect 3G ?

Hi,

 

I have to detect 3G or WIFI or GPRS usage

 

so I put conditions as

 

if(RadioInfo.getNetworkType() == RadioInfo.NETWORK_UMTS)

{

                 // 3G

}

else if(CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_CARRIER,RadioInfo.WAF_WLAN, false))

{

               //WIFI

}

else

{

              //GPRS

}

 

 

But whenever my device is using 3G, its never go in 3G block. I have tested on simulator and device(9700) as well .

 

I have changed 3G condions to "if((RadioInfo.getNetworkService() & RadioInfo.NETWORK_SERVICE_UMTS)>0)"

 

Still its not detecting 3G. Please help me regarding 3G detection !!!

 

 

Thanks !!!

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: How to detect 3G ?

i am using

(service & RadioInfo.NETWORK_SERVICE_UMTS) > 0

inside of a RadioStatusListeners networkServiceChanged, it works well.

RadioInfo.getNetworkServices should deliver the same flag though.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Regular Contributor
Aditi
Posts: 69
Registered: ‎10-11-2010
My Device: Not Specified

Re: How to detect 3G ?

[ Edited ]

Thanks Simon,

 

Thanks for the reply.

 

Here you have mentioned "(service & RadioInfo.NETWORK_SERVICE_UMTS) > 0".

How can i get  "service" ?

Do you mean to use "(RadioInfo.getNetworkServices() & RadioInfo.NETWORK_SERVICE_UMTS) > 0"

inside networkServiceChanged() method ?

 

Best Regards !!!

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: How to detect 3G ?

http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/system/RadioStatusListener.htm... int)

 

the second parameter is the service.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Regular Contributor
Aditi
Posts: 69
Registered: ‎10-11-2010
My Device: Not Specified

Re: How to detect 3G ?

Thanks Simon once again,

 

I have one more query,

How will i check for GPRS by using RadioStatusListner ?

Because I need to check for 3G and GPRS both.

 

Best Regards !!!

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: How to detect 3G ?

http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/system/RadioInfo.html#getActiv... with http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/system/RadioInfo.html#WAF_3GPP but no UMTS but data coverage i would say.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.