简体   繁体   English

在服务器和客户端之间通过android中的wifi传输数据

[英]Transfer Data over wifi in android between server and clients

How can I do these steps in android (Eclipse)? 如何在android(Eclipse)中执行这些步骤? In a simple example. 在一个简单的例子中。 I am beginner. 我是初学者。 For transfer data over wi-fi. 用于通过wi-fi传输数据。

  1. Server device opens a socket and listens on it. 服务器设备打开一个套接字并对其进行侦听。
  2. Server device broadcasts the local IP and Port it's listening on. 服务器设备广播正在监听的本地IP和端口。
  3. Client devices receive broadcast and initiate a connection. 客户端设备接收广播并启动连接。
  4. Transfer data between server and each client or clients and server. 在服务器与每个客户端或多个客户端与服务器之间传输数据。

This is very broad and would require a lot of code to show, and therefore I recommend viewing 这非常广泛,需要显示很多代码,因此我建议查看

http://developer.android.com/guide/topics/connectivity/wifip2p.html http://developer.android.com/guide/topics/connectivity/wifip2p.html

WifiP2P is very cool, but can be tricky to setup. WifiP2P非常酷,但是设置起来很棘手。 If you want to start playing around with wireless communication you may want to look at the BluetoothChat Example . 如果您想开始进行无线通信,则可能需要查看BluetoothChat Example

Bluetooth and specifically Bluetooth Low Energy are emerging as the standard communication protocol for Internet of Things. 蓝牙,特别是低功耗蓝牙正在成为物联网的标准通信协议。 If you want to start digging into what you can do the example should work right off the bat with the latest version of Android Studio. 如果您想开始研究您可以做的事,那么该示例应立即与最新版本的Android Studio一起工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM