How to send file / message between two android device with out any intermediate server

青春壹個敷衍的年華 提交于 2019-12-10 21:48:23

问题


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.


回答1:


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.

If the internet is not a prerequisite, you can follow Minav Patel's suggestion and use the Android Bluetooth implementation.

Another solution would be the WiFi-Direct feature (if the phone support it). See here for an example.




回答2:


You can implement file transfer between two android devices using android bluetooth implementation.Go through following links it will help

android bluetooth implementation basics http://developer.android.com/reference/android/bluetooth/BluetoothSocket.html http://developer.android.com/guide/topics/connectivity/bluetooth.html



来源:https://stackoverflow.com/questions/18356172/how-to-send-file-message-between-two-android-device-with-out-any-intermediate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!