how to setup connection between PC and android devices through wifi

Deadly 提交于 2019-12-24 10:35:38

问题


i am developing android application which runs in my pc and connects to different android devices through wify and communicate with them,how i setup wifi connection for this purpose,is it possible to connect more devices to my pc through wifi,I need to setup connection in ubutu11.10 or windows 7


回答1:


Your question is vague and open to a lot of potentially "correct" answers. First of all, the whole wifi v.s. internet part is irrelevant, you just want to communicate from your Android devices to your pc over the network.

The term to look for is sockets. What you do is listen to particular port on the PC (the "server"). You'll have to open up the relevant ports in the firewall.

You then write an android app that communicates with this server, see here for a proper introduction.

There is no problem using a single socket (ip address + port) to connect with multiple devices, as long as your protocol includes a way for each client to identify itself.

...

That said, you can also do all of this at a higher level, running a SOAP/JSON-based client/server scheme (as opposed to writing your own socket-based protocol). See http://wiebe-elsinga.com/blog/?p=405 for an example.

What is the most appropriate choice depends on your exact requirements (performance, deployment) and your level of experience.




回答2:


If you are looking at establishing an ADB connection to a device try ADB wireless http://www.helloandroid.com/content/connect-your-android-phone-adb-wireless

You will need to root your device for this to work



来源:https://stackoverflow.com/questions/9548539/how-to-setup-connection-between-pc-and-android-devices-through-wifi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!