简体   繁体   English

通过android连接WiFi

[英]WiFi connection via android

I need a tutorial on how to process data on android via wifi. 我需要一个关于如何通过wifi处理android数据的教程。 Fe, I need to send some message to PC and receive some other message. Fe,我需要向PC发送一些消息并接收其他消息。 How should I establish the connection? 我该如何建立连接? What should I do to be able to transfer data and how? 我该怎么做才能传输数据?如何?

Sorry for the dummy question, but I can't find good manual. 抱歉这个虚拟问题,但我找不到好的手册。 I'll be grateful for as detailed manual as possible, or for ome simple example on etablishing wifi connection and sending/receiving simple mesages. 我将尽可能详细的手册,或者关于建立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, 您不必使用任何API连接到wifi,只需要手动启动设备中的wifi,

Just make sure your device has a WiFi enable, and make a simple TCP/IP Socket application . 只需确保您的设备具有WiFi启用,并制作一个简单的TCP / IP套接字应用程序 With this you can communication with your system and device, And Use System's public IP to connect with your system. 通过此功能,您可以与系统和设备进行通信,并使用系统的公共IP连接系统。

Also don't forget to give permission Internet in your manifest file.. 另外不要忘记在清单文件中给permission Internet ..

Here some nice links for Socket Programing in Android.. 这里有一些很好的Android链接编程链接..

Simple connection example part II - TCP communication 简单连接示例第II部分 - TCP通信

Networking with Android 与Android联网

Simple communication using java.net.Socket 使用java.net.Socket进行简单的通信

http://www.anddev.org/tcp_sockets-t276.html http://www.anddev.org/tcp_sockets-t276.html

http://www.anddev.org/socket_programming-t325-s30.html http://www.anddev.org/socket_programming-t325-s30.html

EDIT:: Android WiFi examples, 编辑:: Android WiFi示例,

Scan for Wireless Networks 扫描无线网络

Using WiFi API 使用WiFi API

SO Question Android: Is there any way to get notified when known wifi networks get in/out of range? SO问Android:当已知的wifi网络进入/超出范围时,有没有办法得到通知?

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

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