views:

321

answers:

3

I'm working on some apps for the android platform and I have two problems that I'm not quite sure how to approach, and both are closely related.

  1. How can I send a relatively small data file from one android device to another (preferably over the internet or directly through wireless network)?

  2. Is it possible to create a temporary p2p live data stream from one android device to another? An example application would be to stream low-res video from phone A's camera to phone B, or audio.

I would much appreciate being pointed in the right direction on either issue (File transfer or real time data transfer).

A: 

One approach would be to use the socket classes in java.net.

RickNotFred
A: 

To use WiFi to send data among devices, you can try to establish an ad-hoc network among the devices that will communicate. I think you can use Android's WiFi API to do that. Once you have the ad-hoc network setup, you can establish a simple TCP connection between the devices and transfer the files.

jaxvy
A: 

Sockets do not work between phones. I've tried with two actual phones using socket communications and there seems to be a firewall in the carriers that prevents communications on ports different than port 80. Then if you try to use port 80 you get a 'Permission Denied' exception.

Jaime Botero