views:

573

answers:

3

Does mono touch allow you to do cross iPhone communication? (iPhones in the same room) If so, what's the API?

+1  A: 

I would start here (MonoTouch API) and also reference this (MonoTouch Assemblies) which lists System.dll and includes the System.Net.Sockets namespace so some communication seems possible although I don't believe any of the interaction will be built for you. You might however be able to utilize and recompile some existing communication libraries using .NET against MonoTouch for distribution on the iPhone.

Quintin Robinson
Is it using TCP or bluetooth?
tom greene
Well sockets communication is TCP/UDP, I don't know if the MonoTouch API has any bluetooth wrapping built in.
Quintin Robinson
I looking for iphone to iphone communication without a server
tom greene
Well I'm sure adhoc communication is possible using UDP for instance, either way, what is posted is what is available through MonoTouch.. In almost any case you are going to have to write some code to implement whatever you are trying to do.
Quintin Robinson
So how do you discover other iPhones?
tom greene
+2  A: 

This is not a MonoTouch problem, it is a Cocoa Touch problem. Using MonoTouch really requires that you still learn Cocoa Touch as well.

What you want to use is the GameKit framework that is a zero-config local networks over bluetooth. There are no GameKit bindings for MonoTouch yet, so you must look into:

  • Learn the internals of MonoTouch.
  • Learn the internals of Objetive-C.
  • Use what you learned to write C# to Objective-C bindings for the GameKit framework.

As you might imagine, a faster solution is to skip MonoTouch for this use case, and go directly to Cocoa Touch where everything is already in place. Brace yourself and spend a few days learning Objective-C.

PeyloW
How exactly does that *help*? It's basically a yes/no question with a request for followup info if the answer is yes. I'm boggled by the animosity toward MonoTouch when nobody's forced to use it. If you want to use Objective-C, then why give someone else a hard time for wanting to use something else? Been seeing these comments around, and I'm utterly perplexed. I actually *like* writing bindings to bring more functionality to my MT code. Maybe I'm sick, but the process is fun, and it's *improved* my understanding of Objective-C and CocoaTouch. Nobody's trying to stop *you* from using ObjC.
Rory Blyth
+5  A: 

Use the MonoTouch.GameKit API to communicate with other nearby iPhones. It is available in MonoTouch 1.1.1 (released on October 8th).

Here is an introduction to GameKit programming:

http://developer.apple.com/iPhone/library/documentation/NetworkingInternet/Conceptual/GameKit%5FGuide/Introduction/Introduction.html

miguel.de.icaza
You rock sir. I am always excited to see the fantastic work you do.
Quintin Robinson
This link is now invalid. The new one appears to be http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/GameKit_Guide/Introduction/Introduction.html
NeilDurant