0

Using

HttpGet httpget = new HttpGet(urlToGet); 

I get an intermittent error that results in a forced closure of the app. The error is always Host is unresolved: www..com:443

How can I stop this from happening?

1
  • few questions: Are you connected to internet? Are you trying this code from behind a proxy? can you browse to this URL from browser? Which SDK are you using? Commented May 14, 2010 at 5:46

2 Answers 2

1

Elsewhere, I answered a closely related question to this one: remove your AVD (emulator), then re-create it. (Also, make sure you've got that magic Internet permission statement in your manifest file, but I assume that's not your problem.) I don't know if this will do it for you, but it worked like a charm for me. Apparently, this is a fly in Android's ointment.

Sign up to request clarification or add additional context in comments.

1 Comment

I simply tried your advice on the odd chance it might be it and it actually fixed it. Anyone who might be as lost as I was : restarting the AVD Emulator is something to try.
0

If all normal solutions fail (permissions are ok, encoding is ok, url is working on your computer), you might have to edit your Android's hostfile. Suppose the url works in your pc's/mac browser, but not on your android phone, check the host files on your computer (windows/system32/drivers/etc/ or private/etc/) and see if you're url is re-directed in the host file.

If so, you must add it to your Android's phone hostfile as well. http://forum.xda-developers.com/showthread.php?t=514698

Also see http://en.wikipedia.org/wiki/Hosts_(file) for more info... I 've had this once when a webservice was still in testing mode

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.