Monday, May 20, 2013

0 Tips to solve the UnknownHostException on Android


See all 4 photos

Lately I've seen so many java and android developers getting the annoying UnknownHostException message while trying to connect the Android emulator to the internet. I've had this problem too and I know it is how much it is really irritating. So I decided to share you guys some of things you should check before trying to make your android connect to web.

1. AndroidManifest.xml:

  • The very first thing is the AndroidManifest.xml, it got to have the permission to connect the internet. So, check if it has the following line (it is a must, don't try anything related to internet before that):

2. Test the connection using the web browser, to see if it's a code or a emulator problem.

  • To eliminate if the connection problem is from your code or your emulator, run a web browser and try to connect to any trustful web site like www.google.com


See all 4 photos

3. Check your firewall settings.

  • Another common problem is your firewall blocking your Android emulator to connect to the internet. In this case you should open your firewall and permit or bypass emulator connections. Below is an example of a windows firewall permitting android emulator connections.


See all 4 photos

4 . Share your network connection (If all fails).

  • That one was tricky, I was almost giving up when this idea came to my mind, so I decided in a desperate try, share the connection on windows and BAM! My android emulator finally connected to web. See below the picture to got an idea on how I did this on Windows XP.


See all 4 photos

So that is it. That was my tips and problems that I found while trying to connect my Android emulator on the web. If you guys have another tip, please comment and share, lets help each other and stop banging our heads on the desk. :)

Thank you for reading. Take care. See ya.

0 comments:

Post a Comment

 

Android Freeware Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates