2

I'm tired of having to go through a lot of pointless menus on the iPhone just to enable / disable bluetooth and would like to make myself an app that basically just enables / disables the bluetooth on my phone. I have a developer account with Apple, so deployment wouldn't be a problem (can do ad-hoc deploys).

I've been searching, but couldn't find any APIs that let me do this. Does anyone know of any? Can someone open source the code if they've built this for personal use?

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
Tejaswi Yerukalapudi
  • 8,987
  • 12
  • 60
  • 101
  • 1
    http://stackoverflow.com/questions/1743610/programmatically-turn-on-bluetooth-in-the-iphone-sdk – Mahesh Feb 13 '11 at 10:08

1 Answers1

2

To my knowledge, this requires use of private APIs. Unless you wan't to reinvent the wheel, I recommend jailbreaking your phone. I have sucessfully done this using GreenPois0n. When done, you get access to Cydia - an alternative App Store for all things Apple won't approve.

Download SBSettings from Cydia. Now you can just swipe the status bar to quickly enable/disable bluetooth, 3g, airplane mode, wifi and more:

enter image description here

Some other tips and reasons you should jailbreak your phone:

  • By downloading the plugins "Push" and "Push" mail to SBSettings, and by purchasing SBSchedule from Cydia, you can have profiles on your phone. I created two sets. "Push on" and "Push off". These can be selected by holding the on/off button. I have also set SBSettings to automatically switch to "Push off" at 23:00 and "Push on" at 07:00 to avoid getting disturbed by push notifications at night.
  • Purchase LockInfo from Cydia. See more information and screenshots here. This gives you "widget" support on your lock screen.
  • As a developer, I have also purchased "Display Out" which enables you to use the iPads VGA adapter on your iPhone (or iPad) to mirror the screens onto a projector (Steve Jobs mode). "Display Recorder" is a screen recorder enabling you to record instruction videos for your apps.
Mads Mobæk
  • 34,762
  • 20
  • 71
  • 78
  • 1
    I think that you're missing the point of the question: Is it there any API to enable/disable the BT service? The topic it wasn't about how to jailbreak the iPhone. – garzanti Feb 13 '11 at 12:34
  • As I said in the first sentence, there isn't a public API for this. Using private frameworks as suggested in Mahesh's comment is possible. My suggestion answers the original problem: "I'm tired of having to go through a lot of pointless menus on the iPhone just to enable / disable bluetooth". Creating an application using private API calls to enable/disable BT is one way, but in my opinion you get a better solution and more options by jailbreaking. – Mads Mobæk Feb 13 '11 at 14:06
  • Mobæk From my point of view the response would've a been a simple, no there is no public API for this. The private API is not something you care rely on and it is not about jailbreaking the iPhone, maybe tommorow Apple changes his mind and remove it completely. – garzanti Feb 13 '11 at 14:53
  • 2
    @garzanti: Well, then we have different views on this. If I hadn't answered this question, he would have had one option to choose from. Now he has two. You're suggesting that we should give him none. There is often more than one answer to a question, and in this case, both the private API and jailbreaking is a valid option. The author is trying to solve a problem on his **own** phone - he's not intending to put it on App Store. Why should he not know his options? If Apple changes their mind, someone will find another solution. As a developer, he probably know private APIs can change. – Mads Mobæk Feb 13 '11 at 17:44