Can Android Do Peer-To-Peer Ad-Hoc Networking

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

Here's a bug report on the feature you're requesting.

It's status is "reviewed" but I don't believe it's been implemented yet.

http://code.google.com/p/android/issues/detail?id=82

Android ad-hoc / access point connection capabilities

The short answer is, you can't directly through the SDK. Some phones / revisions may have factory or other support to do so, but you can't rely on the SDK to do this.

Android Wifi direct multiple connection ad-hoc

Android does not have support for ad-hoc WiFi at this time -- sorry!

Update (2019): Android has supported WiFi Direct for a while, and this answer has not been updated.

Your scenario would work. A would be able to connect with C as long as B (the group owner) is within range of both A and C.

See Android's developer documentation for more info:

https://developer.android.com/guide/topics/connectivity/wifip2p

Is possible to connect more hotspots?

Yes, you need to use WiFi Direct for this. When using WiFi direct in concurrent mode, and device can act as both a client and an AP the same time. This is what you need. Whether it will work for you as is, depends on your specific device and driver, but there is support for WiFi Direct in Android since v4.0. Sometimes WiFi Direct is also called WiFi Peer-To-Peer or WiFi P2P and this is what the Android API calls it.

see Android WiFi P2P

With the Android API you can discover other peers and services you define and connect to them.

The WiFi p2p utilities are under very active development, so I am not sure if the Android is currently supporting the concurrent mode. You can try. However, you can also setup your connections directly by using the wpa_supplicant utility which is actually what Android is using internally. I have been able to use this directly from my applications for other purposes. If the version that Android is using is not working, or if you find it a bit unstable, you can get the latest version from the hostap and wpa_supplicant projects. Installing those may require root access though.

How to set up an android peer to peer networking for a game?

There are a couple different ways you can do this, it really depends on which one is the best fit for your situation.

  • If you want a complete ad-hoc approach and you have the right phone, take a look at Wifi Direct.
  • Use a Web server to coordinate message exchanges
  • Depending on your Game and the distance between players you may be able to use a small Bluetooth network


Related Topics



Leave a reply



Submit