您好我正在使用Android工作室而我正在尝试将我的Android手机连接到我的网络服务器,我可以通过我的网络浏览器连接好但我没有通过手机连接成功:
这是我通过Android应用程序连接的代码:
URL url = new URL("http://raspberrypi/test.php");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setReadTimeout(10000);
connection.setConnectTimeout(10000);
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
我的日志目前输出以下内容:
04-13 05:07:53.770 19471-19471/? I/art: Late-enabling -Xcheck:jni
04-13 05:07:53.770 19471-19471/? I/art: VMHOOK: rlim_cur : 0 pid:19471
04-13 05:07:53.870 19471-19471/com.example.albert.superlyduperdoorsystem E/Typeface: SANS_LOC file not found.
04-13 05:07:54.300 19471-19471/com.example.albert.superlyduperdoorsystem D/libc: [NET] android_getaddrinfofornet+,hn 11(0x72617370626572),sn(),hints(known),family 0,flags 4
04-13 05:07:54.300 19471-19471/com.example.albert.superlyduperdoorsystem D/libc: [NET] android_getaddrinfofornet-, err=8
04-13 05:07:54.390 19471-19471/com.example.albert.superlyduperdoorsystem D/Atlas: Validating map...
有人有什么想法吗?