I have an API in php, that sends data in JSON format. I made the following code, that works fine when I am on wifi. But when I want to download the data from the API when
I got this error while debugging an android app on Android Studio via USB. Connection attempts failed with one tablet but not with my regular test tablet. It turned out that the failure was due to the fact that I hadn't enabled WIFI settings on the failing machine. So I enabled WIFI on it and it connected to server OK.