如何使用发送任何中间服务器两款Android设备之间的文件/消息 [英] How to send file / message between two android device with out any intermediate server
问题描述
我要使用带出使用任何中间/服务器网络连接的两个设备之间发送文件。例如有两个设备A和B都拥有自己的网络连接和设备都已经安装了应用程序,现在需要从设备A发送一个文件给设备B.设备A可以知道所有有关设备B.细节
I want to send files between two devices using internet connection with out use any intermediate /server. For example there are two device A and B both have internet connection and both device have installed my application, now need to send a file from Device A to Device B. Device A can know all the detail about the Device B.
这是可能的手段引导我正确的方式。先谢谢了。
Is this possible means guide me in the correct way. Thanks in advance.
推荐答案
您可以使用点对点架构来实现这一目标。基本上每个手机是一个客户机和一个服务器的同一时间。见<一href=\"http://thinkandroid.word$p$pss.com/2010/03/27/incorporating-socket-programming-into-your-applications/\"相对=nofollow>这里基本实现。
You can use a Peer to Peer architecture to achieve this. Basically every phone is a client and a server the same time. See here for a basic implementation.
如果互联网是不是一个prerequisite,你可以按照Minav帕特尔的建议,并使用Android的蓝牙实现。
If the internet is not a prerequisite, you can follow Minav Patel's suggestion and use the Android Bluetooth implementation.
另一种解决方案将是WiFi的直连功能(如果手机支持的话)。请参见这里的一个例子。
Another solution would be the WiFi-Direct feature (if the phone support it). See here for an example.
这篇关于如何使用发送任何中间服务器两款Android设备之间的文件/消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!