Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-04-2008, 11:16 AM   #1 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 30
Default Howto programmatically turn on/off WiFi and Bluetooth?

Is there a programmatic way to turn on and off the WiFi and Bluetooth networks on the iPhone? I'm looking for the same functionality that Settings/[General/Bluetooth],WiFi/OnOff provides.

Thanks.
ae6rt is offline   Reply With Quote
Old 09-04-2008, 12:33 PM   #2 (permalink)
Registered Member
 
mosttornbrain's Avatar
 
Join Date: Sep 2008
Location: Woonsocket, RI
Age: 42
Posts: 42
Default

Quote:
Originally Posted by ae6rt View Post
Is there a programmatic way to turn on and off the WiFi and Bluetooth networks on the iPhone? I'm looking for the same functionality that Settings/[General/Bluetooth],WiFi/OnOff provides.
There isn't a way using the APIs provided by the SDK. It's trivial to do if you use private frameworks, but if you use private frameworks, you will be in violation of Apple's SDK license agreement.

I've already written such an app for my own purposes (toggling Bluetooth on and off), but for obvious reasons I can't distribute it. Details can be found here if you are interested:

Stormy Productions: The most useful iPhone app I can't release

Cheers.
mosttornbrain is offline   Reply With Quote
Old 09-04-2008, 01:09 PM   #3 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 30
Default

Thanks. That's what I suspected. Too bad. Hopefully this will be part of the public API one day.
ae6rt is offline   Reply With Quote
Old 09-26-2009, 05:55 PM   #4 (permalink)
Registered Member
 
ghiboz's Avatar
 
Join Date: Apr 2009
Posts: 11
Default

I'm interested about this:
in the PhotoShare application, if the bluetooth is deactived, automatically is activated...
so... how did you think that PhotoShare works??
ghiboz is offline   Reply With Quote
Old 11-15-2009, 11:37 AM   #5 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 123
Default

Can you please tell me how to programatically turn on Bluetooth using the private api.
johnathon is offline   Reply With Quote
Old 11-15-2009, 12:14 PM   #6 (permalink)
Former NeXTStep Developer
 
Join Date: Mar 2009
Posts: 997
Default

Quote:
Originally Posted by johnathon View Post
Can you please tell me how to programatically turn on Bluetooth using the private api.
See link in post #2 above.

joe
FlyingDiver is offline   Reply With Quote
Old 11-15-2009, 01:43 PM   #7 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 410
Default

Yep - the issue is private frameworks. Which means Apple will most definitely reject the app.

There are alternatives, however. The Jailbreak Community can always make use of apps like that. However, from what I've been seeing of late, the "Jailbreak Community" is dying off pretty fast, as a lot of the devs for it are either moving to the App Store, or simply charging obscene prices for once free apps. They either handle their records poorly, or simply don't care, and as a result many "buyers" of their apps have been completely screwed over. ZodTTD, I'm looking at you.
Noise is offline   Reply With Quote
Old 11-15-2009, 04:49 PM   #8 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 123
Default

Thanks for the link but I was wondering actually how to do it (frameworks to import, maybe even some code).
johnathon is offline   Reply With Quote
Old 11-15-2009, 09:18 PM   #9 (permalink)
Shmoopi Gaming
 
Shmoopi's Avatar
 
Join Date: Jun 2009
Posts: 181
Default

Quote:
Originally Posted by johnathon View Post
Thanks for the link but I was wondering actually how to do it (frameworks to import, maybe even some code).
You're going to find a hard time finding that code here, I would suggest you try searching through some cydia apps source code such as Bossprefs or Customize. You can also try searching through the "System" commands that the iPhone utilizes. For example:
Code:
system("killall springboard");
__________________
Check out Shmoopi Gaming in the App Store!
Shmoopi is offline   Reply With Quote
Old 11-16-2009, 11:44 AM   #10 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 123
Default

I found this but how do i use it. How do I refere to the bluetooth?
johnathon is offline   Reply With Quote
Old 02-02-2010, 10:43 AM   #11 (permalink)
KZS
Registered Member
 
Join Date: Jan 2009
Location: Ontario, Canada
Posts: 47
Default

Hey, did you get anywhere with this lately? I hope Apple releases some new APIs in OS 4.0.
KZS is offline   Reply With Quote
Old 02-03-2010, 12:11 PM   #12 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 123
Default

Quote:
Originally Posted by KZS View Post
Hey, did you get anywhere with this lately? I hope Apple releases some new APIs in OS 4.0.

Yeah, I figured out how to toggle bluetooth
johnathon is offline   Reply With Quote
Old 02-03-2010, 01:28 PM   #13 (permalink)
KZS
Registered Member
 
Join Date: Jan 2009
Location: Ontario, Canada
Posts: 47
Default

Quote:
Originally Posted by johnathon View Post
Yeah, I figured out how to toggle bluetooth
Awesome. Did you use the above references to figure it out? I haven't had a chance to look at them yet.
KZS is offline   Reply With Quote
Old 02-04-2010, 01:00 PM   #14 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 123
Default

Quote:
Originally Posted by KZS View Post
Awesome. Did you use the above references to figure it out? I haven't had a chance to look at them yet.
i used the private framework called bluetooth manager. i found the .h in spotlight somehow
johnathon is offline   Reply With Quote
Old 02-17-2010, 09:21 PM   #15 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 1
Default

I think its very easy to create an app which turn off/on iphone's bluetooth and wifi. However, a bit functional app should be developed which is used to organize the iphone functions through that app like Bluetooth toggling, wi-fi turn off/on etc. The app can also be interfaced with apple iphone accessories to respond accordingly e.g the app could be configured to open up ipod when-even head-pones are connected

Though iPhone is a smart-phone, yet it is not a complete smart-phone. There are many features in the phone that are not automatic but there may be programs that makes them automate but I haven`t found any for the automatic WI-FI turn on/off.

I have personally used bluetooth toggle installed from cydia, however never used any of the wifi application.
ronnie williams is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 23,873
Threads: 38,649
Posts: 169,646
Top Poster: smasher (2,547)
Welcome to our newest member, JBTech
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:25 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0