Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending over WFi

 
Mike Brooks
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,

I am new to android development and I am trying to find out how to send files over WiFi. I have failed to find any tutorials on the topic and was hoping you could help or point me in the right direction.

Regards
Mike
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "send files" - what protocol do you intend to use? If you're talking about an HTTP file upload, then I think there are versions of Apache HttpClient for Andoid out there.
 
Mike Brooks
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey what I was planing on doing was using HTTP in a program to send a file to another phone which would use HTTP to receive.

What I'm not sure on is if you can use sockets to send a recive files between androids phones. Or is there a better way to do this.

Regards and Thanks
Mike
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the receiving phone have a static IP address? It would need to have one in order to be reliably addressable through TCP/IP. But somehow I doubt that most (or any) phones have that.

Maybe you could compose an MMS that contains the file contents? MMS are something that phones know how to send and receive; I foresee a lot less problems that way than if using HTTP.
 
Mike Brooks
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would it be possible to do using bluetooth and if so is there any good tutorials on the topic. I just thought it would better due to the higher speed to send between phones over 802.11.

Thanks
Mike
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't dug deep into 2.0 to see what is new, but previously, this wasn't something google provided in the SDK (file transfer over BlueTooth), however, this site looks like it has some promise:

http://www.androlib.com/android.application.it-medieval-blueftp-qAFE.aspx
 
Tim Holloway
Saloon Keeper
Posts: 18367
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sending files via Bluetooth is commonly done via OBEX, which, alas, Android 1 doesn't support. Google has improved Bluetooth for Android 2.0, but it's unclear as to how extensive the improvements are.

Another alternative would be PAN. Fedora 10 (Linux) automatically adds a bluetooth PAN device to the collection of network devices when it detects Bluetooth hardware (I'm using a dongle). However, I'm not optimistic that my current handset can run tcp/ip via Bluetooth.

When you network two computers (for networking purposes, a phone is a "computer", too), the normal mode of operation is that the network stack selects the interface(s) that it deems most suitable. This can be based on whether a path from one computer to the other is physically available and how "expensive" it is. You don't normally open an interface, you open a connection. So whether the phone opts to go via WiFi, the carrier's own data services, or both can vary. But the point is, since all that is transparent, the app doesn't need to worry about it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic