Search code examples
androidwifiandroid-wifi

Connect two android phones with wi-fi (without laptop or access point) and send file


Is it possible to connect two android phones by wi-fi, without using a bluetooth/GSM/CDMA/IR? Also, there is no any laptop or wi-fi access points or wi-fi routers.

I think, that it is possible to create some SSID on both phones, do a static configure of IP addresses. Will android connect to another's android wi-fi?

If they will be connected, how can I send a file from one phone to second? Is there a ftp-client and server? or Can I ssh to other phone? Or telnel/netcat? Maybe http ?


Solution

  • This is called ad hoc network and has been asked before:

    Can Android do peer-to-peer ad-hoc networking?

    Android Wifi direct multiple connection ad-hoc

    Android ad-hoc / access point connection capabilities

    Update:

    Short answer: ad hoc is not yet supported on Android so this would not work.

    You can use Bluetooth to connect two Android phones in a p2p fashion.

    Update 2:

    Direct device-to-device connection over Wifi is supported under API 14 in Android 4.0 ICS in package android.net.wifi.p2p. You can test devices capability via FEATURE_WIFI_DIRECT.