Sockets - Connecting two mobile devices

You must Login before you can answer or comment on any questions.

I am new to titanium yet I have been a developer for 15 years.

I have been given the task of creating an iPad application that allows multiple ipads to be connected to one iPad so they can share information over a local wireless network.

The idea is that one person (the host) starts an application and 'invites' other local users to join their session. The clients use their individual iPad applications and submit information to the host where the host application collates the information and displays it on the screen. , What I'm really looking for here is not actual code but a clear understanding that titanium is capable of creating such a program. I have briefly looked at the sockets API but I'm still unsure that titanium will work for this type of project.

Any advice or help would be appreciated...

Regards, Scott.

2 Answers

Hi Scott

If this is just for the iPad (or other iOS devices), then what you are after is the Bonjour functionality in Titanium.Network. The BonjourService method lets you publish a service and the BonjourBrowser method lets you search for these services. Note that this only works for devices which are all behind the same router.

What you can then do with these methods is create a host, let clients search for this host and then use the information gathered from the service name (IP/Post) to connect to the host using the Titanium.Network.TCPSocket class, or stick with Bonjour for passing simple messages between client<->host.

For an example of this in (sort of) action, check it out in the extremely useful KitchenSink application.

Hopefully this gets you on the right track :)

Cheers, Angus

— answered 3 years ago by Angus Peart
answer permalink
1 Comment
  • Thanks Angus... This is great news, Just what I needed to hear. i'll get started straight way.

    Regards,

    Scott.

    — commented 3 years ago by Scott Smith

Hi,

BonjourService doesn't work on android. Is this right?

Thanks

Your Answer

Think you can help? Login to answer this question!