To connect the emulator to localhost, the urls...
"http://localhost:" + portNumber + "/" + subDirectoryName
"http://127.0.0.1:" + portNumber + "/" + subDirectoryName
... won't work. Use instead...
"http://10.0.2.2:" + portNumber + "/" + subDirectoryName
For more info on this, see the Android developer Using the Android Emulator page, Emulator Networking section:
http://developer.android.com/guide/developing/devices/emulator.html#networkaddresses
No comments:
Post a Comment