简体   繁体   中英

WiFi connection via android

I need a tutorial on how to process data on android via wifi. Fe, I need to send some message to PC and receive some other message. 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.

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,

Just make sure your device has a WiFi enable, and make a simple TCP/IP Socket application . With this you can communication with your system and device, And Use System's public IP to connect with your system.

Also don't forget to give permission Internet in your manifest file..

Here some nice links for Socket Programing in 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 examples,

Scan for Wireless Networks

Using WiFi API

SO Question Android: Is there any way to get notified when known wifi networks get in/out of range?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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