I want to develop an Android app that connects with a Windows desktop application via TCP/IP. However I have very little knowledge of networking and so please forgive me if this is a very basic doubt.
My Windows based laptop as well as Android phone are connected to the internet via the same WiFi router. Now I checked the IP address for my laptop as well as phone using a website. Both are same! If both have the same IP address, then to achieve networking between these devices I will choose different set of port numbers.
- Will this connection work?
- Is the connection happening via the internet or just locally on my router?
EDIT: After reading the answer from @Doon, I have broadened my question.
Let's say the local address of laptop is 192.168.1.10 and that of phone is 192.168.1.20. If I code my application to use these IP addresses, it should work as it is a local network. But what if I want my laptop to connect with another phone which is not connected to the WiFi router, rather by 3G network. Then which IP address should be used for the laptop and the other phone? Since I am not allowed to use any other server, I am going to use port forwarding i.e. the user will type in the IP address displayed on the other device. The connection could be initiated on either one of the devices.
If you could also show how to do this programmatically, it would be very helpful. My Windows application is developed in C++ using Qt.