问题
I am looking for the best, if any, programmatic way of connecting two or more Android phones to each other through the use of either Bluetooth or preferably, Wi-Fi. Apparently Android devices still do not have ad-hoc Wi-Fi capabilities and I am trying to create a peer based program without the use of any central server.
I want to accomplish this without the use of modification to the phones (no rooting). It is even fine to have a phone act as an access point with no Internet access to its clients if that is possible, I just need a mobile network.
回答1:
I have 2.2 on my Android phone and it does have tethering - it can create a wireless access point then other devices can connect to it.
To prevent it having the internet, just turn mobile internet off.
回答2:
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.
来源:https://stackoverflow.com/questions/4752478/android-ad-hoc-access-point-connection-capabilities