简体   繁体   中英

TCP connection between Android App and PC

I'm trying to create a TCP connection between my PC and Android smartphone to send text from the PC (Client) to the Android App (Server).

I found a tutorial which helped me with the code for the App which creates the server ( http://pastebin.com/z0xPSAvP ).

Now I'm struggling connecting my client with the server. The client is programmed with "AutoIt"

http://pastebin.com/tCW5bK9V

When I run the client the "could not connect to $socket" msg-box is displayed.

Could someone tell me what I'm doing wrong here?

Both devices are in the same Network (smartphone via WiFi and PC via LAN) and I checked for the smartphones IP in the smartphone settings.

First, try to access something like Google from your Android phone using its mobile browser. Maybe something still wrong with the network.

Then create a version of the server that could deliver simple HTTP response, visible from the Android mobile browser. Doing so with success eliminates firewalls and all client-related issues from the list of possible problems, making sure the server works and is accessible.

If it still does not work after you demonstrate connection between server and mobile browser, I would suggest to write the client in Java first using the this tutorial . You can try AutoIt and other more exotic approaches after you get anything working at all.

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