0

Well I'm trying to access my webapp from my android emulator device an exception is throwing: java.net.SocketException: socket failed: EACCES (Permission denied)

In browser all right:

Browser access from http://192.168.25.7:8080

But When I try to access it from my app:

App code and thrown exception

How should I make it work?

Note: I'm using Tomcat 9, vraptor to webapp and eclipse to android programming.

4

2 回答 2

1

使用:http://10.0.2.2:8080代替从模拟器访问您电脑的本地主机

于 2017-04-01T01:18:28.880 回答
0

请确保您在 AndroidManifest.xml 中具有访问网络的配置权限。例如:

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

但是你首先像MoQ的建议那样改变你的IP。

于 2017-04-01T01:34:13.713 回答