WiFi connection via android

后端 未结 1 1052
予麋鹿
予麋鹿 2020-12-28 23:25

I need a tutorial on how to process data on android via wifi. F.e., I need to send some message to PC and receive some other message. How should I establish the connection?

相关标签:
1条回答
  • 2020-12-28 23:50

    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?

    0 讨论(0)
提交回复
热议问题