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 Contributor
Posts: 2
Registered: ‎06-27-2011
My Device: Curve 8900
My Carrier: Airtel

How to turn off Data services

Hi all


We are working on an application which will turn off Data services (EDGE/GPRS/3G) when the device is connected to a Wi-Fi network.  is there any API to turn off Data services programmatically?  Any help in this would be greatly appreciated?

 

Thanks in advance

Pradeep


Developer
Posts: 16,997
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to turn off Data services

welcome to the support forum.

you can disable networks by using
http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/system/Radio.html#deactivateWA...
----------------------------------------------------------
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
New Contributor
Posts: 2
Registered: ‎06-27-2011
My Device: Curve 8900
My Carrier: Airtel

Re: How to turn off Data services

Thanks Simon for you reply.

I tried to turn off data services using the code Radio.deactivateWAFs(RadioInfo.WAF_3GPP), however it is turning off Mobile network as well.  Is it possible to turn off Data services without disconnecting from the Mobile Network, so that user can recieve calls.

New Contributor
Posts: 5
Registered: ‎07-11-2011
My Device: Storm 2 9550
My Carrier: Verizon

Re: How to turn off Data services

I have the same problem. Could someone help us?

thanks
Highlighted
New Contributor
Posts: 5
Registered: ‎07-11-2011
My Device: Storm 2 9550
My Carrier: Verizon

Re: How to turn off Data services

I found that, RIM does not provide API to turn off data services, so may we have to work around by use PersistentObject to change data services value. May the code like this:

 

PersistentObject persist = PersistentStore.getPersistentObject( OptionsDataServicesData.ID );

persist.setContents( new OptionsDataServicesData() );

persist.commit();

 

OptionsDataServicesData.ID is a unique long number, example: long MY_DATA_ID = 0x33abf322367f9018L;

 

but I don't know exactly value. Could someone know value of this ID?