I want to connect with my phone to my app database but I keep seeing this error:
Connection Error! java.net.socketTimedoutException:failed to connect to /192.168.1.6 (port : 80) from /192.168.1.7 (port : 53030) after 10000 ms
this is my API class
public class API {
private static final String BASE_URL = "http://192.168.1.6/uni/";
public static Retrofit myRetrofit = null;
public static Retrofit getAPI() {
if (myRetrofit == null) {
myRetrofit = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build();
}
return myRetrofit;
}
}
I check firewall and turn off window defender and antiVirus I check this and this one but none of them solve my issue. I check the ports in httpd.conf and my app, also I run my app in emulator and it works fine, my phone is on the same network as my laptop, so can anyone help me???