Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

1458279

Suspended
Original poster
May 1, 2010
1,601
1,521
California
I just got a second IPT 4G and was thinking of some cool things that could be done.

Something along the lines of connecting the two devices via Bluetooth for gaming or other interaction.

I turned on Bluetooth for each and they didn't seem to see each other.
 
Yes, I've never actually released a game that used Bluetooth, but I did make several proof of concepts last year.

I'm not at my computer with the projects on them, but as I recall, they utilized GameKit.

I think Apple has a sample project called GKTank which demonstrates how to do it.

I believe Ray Wenderlich also has a free tutorial on his website covering it, if tutorials are more your thing: http://www.raywenderlich.com/3276/h...player-game-with-game-center-tutorial-part-12

(I had that bookmarked as a tutorial for multiplayer iOS games; I can't remember if it covers wifi only or Bluetooth as well.)
 
I have 1st gen iPod Touch and a 2nd gen so I know that 1st gen didn't have a Bluetooth, but the second one did. And at some point, before I bought the second iTouch I had to pair my 3GS with the simulator and even that worked. First I had to turn on Bluetooth on my Mac and then turn on tethering on 3GS and connect it over USB to the Mac.

GameKit is complicated at first, but once you have all the parts/boilerplate it is pretty straightforward and same code can easily be used from project to project.
 
Yes you can run a game over Bluetooth between two (or more) devices. I did it a couple of years ago. My game was able to work over the local Wi-Fi and when that wasn't available would use Bluetooth if the devices had it turned on.

I used Bonjour to advertise the 'service' (game), NSNetService frameworks, and some low level sockets code. I can't remember the details now.

In "iPhone Games Projects" they discuss networking options. In "iPhone Cool Projects" there is also a good discussion on the topic. Both these books are from Apress and each contain good information on the subject.

In iTunes U (iTunes store) at least one of the older Stanford sessions discussed this topic also. I don't recall which one. It had the basics. This is free.

Also on iTunes U and free is "Advanced iPhone Development- Fall 2010" from Madison Area Technical College course which has a 2hr:11min session on Networking.

Past WWDC session videos are also available on the subject.

BT on iOS is limited. You won't be able to communicate with an Android device for instance.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.