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

Discussion in 'iOS Programming' started by skhoury, Apr 14, 2009.

  1. skhoury
    Expand Collapse
    macrumors newbie

    Joined:
    Apr 14, 2009
    #1
    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
     
  2. robbieduncan
    Expand Collapse
    Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    No, you can't. It's the users choice, not yours.
     
  3. skhoury
    Expand Collapse
    thread starter macrumors newbie

    Joined:
    Apr 14, 2009
    #3
    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?
     
  4. robbieduncan
    Expand Collapse
    Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    You can kind-off check some of it. Look at the Reachability sample...
     
  5. skhoury
    Expand Collapse
    thread starter macrumors newbie

    Joined:
    Apr 14, 2009
    #5
    Thanks, I'll check it out - I wonder if SDK 3.0 implements any of what I'm asking for.
     
  6. robbieduncan
    Expand Collapse
    Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    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.
     
  7. skhoury
    Expand Collapse
    thread starter macrumors newbie

    Joined:
    Apr 14, 2009

Share This Page