开发者

Transfer a file from an Android to another Android via Wifi as it's done by Bluetooth?

I'm making a schoolar proyect which envolves Android programming. I've already done most of the work but now I need to send one file or a buffered string line from an Android phone to another one via Wifi. I can't use the Bluetooth because it's already used and Wifi is pretty much faster. The phone that will send the data is 2.2 and I can use it as a host (or hope that it could work like that) and the receiver will be a 2.1. Any idea of what can I do or where can I get some info???

I think that I have to be more especific in my question. The data that I want to send is the "view" of the camera or the instant "videoview", like an Android Webcam. The Bluetooth is very bussy sending insctructions to a little robot and receiving the status also of the bot. So it would be insane to do it like rastur says as sms.

And Graeme, I am not really interested in how secure it is (or am I wrong and start to worry about it) cause it will only be what the Android camera see and it is for a school proj开发者_如何学编程ect. Could you share me more info please???? Thanks.


I dont think you have lots of choices here. You could send a SMS text message with attachment. Else you are talking about having one device post to some public bulleting board or website and have the other phone pick it up. Really bluetooth is the standard for what you want.


The only way I can see this working is so:

Have one phone set to "listen" to other phones on the network by opening a network connection to listen for UDP packets.

Have the other phone set to "broadcast" by sending out these broadcast packets containing their IP.

The listener should then be able to post data directly to that IP and the other should be able to receive it. (It should be possible for both phones to be listening and broadcasting via UDP as well as having an open listening TCP/IP connection to be ready for incoming data at the same time).

Using UDP without encryption is very insecure. The technicalities in how you would do this is probably better asked in a separate question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜