Jimmy Porto
Jimmy Porto

Reputation: 139

How can I access my webapp from my pc by Android emulator?

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.

Upvotes: 0

Views: 85

Answers (2)

luise li
luise li

Reputation: 11

Please make sure you have config permission to access network in AndroidManifest.xml.For example:

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

But you first change your IP like MoQ's suggestion.

Upvotes: 0

MoQ93
MoQ93

Reputation: 341

use: http://10.0.2.2:8080 instead to access your pc's localhost from the emulator

Upvotes: 1

Related Questions