7

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).

CodeFusionMobile
  • 14,812
  • 25
  • 102
  • 140

5 Answers5

2

You could try to get Google's library libjingle to work on Android. It provides quite advanced NAT Traversal capabilities, which should be able to get through the carriers' firewalls.

Yrlec
  • 3,401
  • 6
  • 39
  • 75
0

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

RickNotFred
  • 3,381
  • 2
  • 24
  • 26
0

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
  • 5,040
  • 1
  • 21
  • 22
0

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
  • 2,263
  • 2
  • 22
  • 14
0

One possibility is to investigate the JXTA framework. The Practical JXTA II book is available online for reading at Scribd.

Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453