我需要一个关于如何通过wifi处理android数据的教程 . F.e.,我需要向PC发送一些消息并接收其他消息 . 我该如何 Build 连接?我该怎么做才能传输数据?如何?
抱歉这个虚拟问题,但我找不到好的手册 . 我将尽可能详细的手册,或者关于 Build wifi连接和发送/接收简单消息的简单示例 .
You don't have to use any API for connect to wifi its only requires if you want to manually start your wifi in device,
只需确保您的设备启用了WiFi,然后制作 simple TCP/IP Socket application . 通过此功能,您可以与系统和设备进行通信,并使用系统的公共IP连接系统 .
另外不要忘记在清单文件中给出 permission Internet ..
permission Internet
这里有一些很好的Android链接编程链接..
Simple connection example part II - TCP communication
Networking with Android
Simple communication using java.net.Socket
http://www.anddev.org/tcp_sockets-t276.html
http://www.anddev.org/socket_programming-t325-s30.html
EDIT:: Android WiFi示例,
Scan for Wireless Networks
Using WiFi API
所以问题Android: Is there any way to get notified when known wifi networks get in/out of range?
1 回答
You don't have to use any API for connect to wifi its only requires if you want to manually start your wifi in device,
只需确保您的设备启用了WiFi,然后制作 simple TCP/IP Socket application . 通过此功能,您可以与系统和设备进行通信,并使用系统的公共IP连接系统 .
另外不要忘记在清单文件中给出
permission Internet
..这里有一些很好的Android链接编程链接..
Simple connection example part II - TCP communication
Networking with Android
Simple communication using java.net.Socket
http://www.anddev.org/tcp_sockets-t276.html
http://www.anddev.org/socket_programming-t325-s30.html
EDIT:: Android WiFi示例,
Scan for Wireless Networks
Using WiFi API
所以问题Android: Is there any way to get notified when known wifi networks get in/out of range?