I have the answer to my question
I tried the following link and it worked for me
https://stackoverflow.com/a/17603378/8101634
what it states is.
1) Connecting android device through USB cable to laptop
2) Switching USB tethering on android device
3) Go to network and sharing center.
4) It will show you the device and click on it.
5) Click on details
6) Take the Ipv4 address from there and use it as URL in android app
7) Re-run your android application
It works