PDA

View Full Version : Can I turn on/off the WiFi/Bluetooth/3G radio's in my code?




skhoury
Apr 14, 2009, 01:51 PM
Hello all,

I was going through the SDK last night and I couldn't find anything that would allow me to switch off and on the Wifi, Bluetooth or 3G radio's in my code. I'd like to be able to create a switch in my interface that could call some code to do this. Similar to what the Settings program does in the iPhone OS.

Anyone have any thoughts on if this is possible? :apple:

thanks for reading,

S



robbieduncan
Apr 14, 2009, 01:55 PM
No, you can't. It's the users choice, not yours.

skhoury
Apr 14, 2009, 01:58 PM
I wouldn't have done it automatically, it would have been implemented via a view/switch button providing the user with ultimate control.

What about checking the status of the radios? i.e. are they currently enabled, disabled?

robbieduncan
Apr 14, 2009, 01:59 PM
What about checking the status of the radios? i.e. are they currently enabled, disabled?

You can kind-off check some of it. Look at the Reachability sample...

skhoury
Apr 14, 2009, 02:04 PM
Thanks, I'll check it out - I wonder if SDK 3.0 implements any of what I'm asking for.

robbieduncan
Apr 14, 2009, 02:05 PM
Thanks, I'll check it out - I wonder if SDK 3.0 implements any of what I'm asking for.

Basically no. User settings are handled through the settings app. Apple don't want developers to take control of this and spread the setting throughout the system.

skhoury
Apr 14, 2009, 02:08 PM
Bummer - thanks anyway.