为了能够连接设备以进行对等连接,您有以下选择:
1.无线直连
2.蓝牙
3.无线热点
这是一个关于如何通过wifi建立聊天的基本教程 http://developer.android.com/guide/topics/connectivity/wifip2p.html
对于蓝牙 http://developer.android.com/samples/BluetoothChat/index.html
您还可以通过以下方式在eclipse中导入这些示例项目:
1 对于WifiDirect - 
转到新建 - > Android示例项目 - >选择API级别16(Android 4.1.2) - > WifiDirectDemo
2   对于蓝牙   - 
转到新建 - > Android示例项目 - >选择API级别16(Android 4.1.2)> BluetoothChat