2

is there any framework/api to easily to find other devices and share data between them?

Not gamekit please. And bonjour would be great but it is to complex to build..Mayby there's any API that uses Bonjour?

EDIT: Is there any API/Framework that is based on Bonjour?

cocos2dbeginner
  • 2,185
  • 1
  • 31
  • 58
  • 1
    What makes you say Bonjour is too complicated to use? Is it really complicated, or does it perhaps allow much greater customization than another service. What happens when you implement another service only to find that down the road it can't do FeatureX like you need. Then you have to rewrite your software to accommodate for that missing feature. – FreeAsInBeer Apr 07 '11 at 17:04

3 Answers3

4

I know that you've dismissed Bonjour outright, but you might be able to leverage a wrapper class to make it more manageable. For example, Bill Dudney created such a wrapper within his sample Bonjour iPhone application (described here). I generated a Mac version of this sample application to show how you can communicate between the iPhone and a desktop PC. You can see this in action in the Networking session of my class on iTunes U, as well as some other examples of peer-to-peer communication.

For device-device discovery and communication, Bonjour or something based on it (like GameKit) is going to be your best choice. Bonjour is the only way to do discovery of local iPhones over Bluetooth, for example (again, GameKit leverages this). It also works transparently with WiFi or Bluetooth, so you can create communication code that is network-agnostic.

GameKit provides a nice abstraction layer above Bonjour, so I wouldn't immediately reject it. You can decide to not use the system-supplied GKPeerPickerController if you were concerned about the user interface of this.

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
  • +1 for the example of bill dudney and your opinion...I don't want to use the GKPeerPickerController so I tried to make my own interface but it never worked...(no peers etc....) and the problem is that gamekit only supports 2 devices (total.) Is there any example of gamekit that uses more than 2 device and doesnt uses GKPeerPicker? Because i want my own interface but i even didnt find any guide on the web :/ any help? – cocos2dbeginner Apr 08 '11 at 12:46
  • 1
    @cocos2dbeginner - Game Kit does support more than just a two-device peer-to-peer connection using the client / server model (I believe the limit is four devices there). Chris posted some code for this yesterday in his answer here: http://stackoverflow.com/questions/5504194/connect-3rd-device-using-gamekit/5570462#5570462 . See also http://www.iphonedevsdk.com/forum/iphone-sdk-development/40710-gamekit-api.html . Note that Bluetooth becomes unreliable when more than two devices communicate, so you might need to rely on WiFi for this. – Brad Larson Apr 08 '11 at 14:26
  • ok I will try this out....but is there really no example project for this server/client model?? – cocos2dbeginner Apr 08 '11 at 15:27
  • @cocos2dbeginner - It should be trivial to modify a peer-to-peer sample application, like the [example I built for my class](http://www.sunsetlakesoftware.com/sites/default/files/GameKitExample.zip) to use `GKSessionModeServer` or `GKSessionModeClient` instead of `GKSessionModePeer`. You might have to add a little logic to determine which of the two to use, if that isn't something you want to be user-selectable. – Brad Larson Apr 08 '11 at 15:48
1

Dropbox has an API:

https://www.dropbox.com/developers

rincewind
  • 2,502
  • 19
  • 26
0

Bonjour would probably be the best to go with. It's supported by Apple, so you can count on it working for years to come and will only get better with time.

FreeAsInBeer
  • 12,937
  • 5
  • 50
  • 82