Unlike the iPhone Simulator (included with the iPhone SDK), the Android emulator just wouldn't load my site by the name I was using locally. Strangely, 127.0.0.1 wouldn't work either, not even with a port number. Frustratingly, I entered my local IP address and a port number in the browser, and I was able to view my site on the emulator.
This morning, some searching revealed that many people hit this same wall. What I found is that localhost and 127.0.0.1 in the Android emulator refer to its own loopback interfaces. To browse to websites on your machine, use 10.0.2.2 instead. Here's the official word from the Android Developer's Guide.
No comments:
Post a Comment