tags:

views:

39

answers:

2

Is it possible ?

Peer-To-Peer connection via WiFi (same Access Point) , how would multiple devices talk on this layer.

Any API available or sources that can be looked into ?

Thanks Yogurt

A: 

Unless you know the IP address assigned to the other peer already, you'd have to somehow have devices inform other devices that they exist.

Are these devices definitely going to be on the same subnet? If so you can try messing around with having the devices send out 'broadcast' packets. I have no idea if the Android API lets actual applications receive these though.

The more reliable approach would probably be to run some centralised server somewhere that devices register with when they go online, and give their IP address when they register. Then they can query that server for which other devices are nearby and what their IP addresses are. If this is to be a central server out on the wider internet, then it means that unfortunately that the device discovery part isn't peer to peer - there is some privacy implication. Another thing if this is a central server is that you'll have to design the querying process to cope with NAT so that querying for other devices on your local network is restricted to the right network, but that you also get their IP address.

thomasrutter
Will static IP's work ? Of-course, server being a Master would solve the purpose for all the client's (slaves) to talk to each other. But , however, our design is not likely to have any server in-between devices to manage and talk between themselves. So , looking for Per-To-Peer via WiFi. So, Any API available or sources that can be looked into ?
Yogurt
To the above comment.... I agree with your point of "you'd have to somehow have devices inform other devices that they exist." --> That seems to be the main concern area
Yogurt
If by "peer to peer" you meen ad-hoc, then you can't do that without rooted phones
Falmarri
The question said "same access point". So it's not ad-hoc. It's peer to peer in the sense that there is a direct TCP connection between two people who are using whatever app this person is writing.
thomasrutter
@Yogurt static IPs are unlikely to be doable since each person's network will be different - unless you control the network. My server idea was only for looking up which clients are on the same network, then a peer to peer connection would be made after this so the bulk of the network traffic would be peer to peer. The server does not need to be on the local network and could be a service you provide.
thomasrutter
"then a peer to peer connection would be made after this so the bulk of the network traffic would be peer to peer"....Yeah, but how ?. Also, is there any API to get Access-Point (Actual IP) to which the device is connected over WiFi?
Yogurt
A: 

Try researching the state of Bonjour / Avahi / Zeroconf on android. I'm seeing some pages that indicate people have made some progress for certain purposes but nothing like a generic howto or ready to use library.

Chris Stratton
Yeah, i did that, but it seems not many guys have got real success on it w.r.t. Android Platform. Hey, in one of the forums got into Smack API (XMPP) for Android , will this serve the purpose ?
Yogurt