Perhaps the emulator has trouble mirroring your computer's DNS setup.

http://developer.android.com/guide/developing/tools/emulator.html#dns

You could try starting the emulator with -dns-server <serverList> option to manually specify the addresses of your computer's DNS servers, to see if it makes the behavior consistent with the host computer.

-- Kostya

13.01.2011 23:09, Dan пишет:
After testing on an emulator and at the same time the host computer is
able to resolve the domain name this issue cannot be isolated to wifi
problems.

-Dan


On Jan 12, 11:00 pm, Bob Kerns<[email protected]>  wrote:
UnknownHostException means your device was unable to get a positive
response to the DNS query trying to look up the hostname.

It doesn't distinguish between "We couldn't talk to the DNS server",
"we have no network connection right now", "we have never even HEARD
of net work, what's that?", or "we carefully and thoroughly discussed
it with the DNS server, which in turn discussed it with the relevant
authoritative DNS servers, and can conclusively state, that the host
named does not exist at this time".

What you CAN say, is it never got to the point of actually trying to
talk to that host, because it didn't get enough information to do so.
That is, it is not saying "we've heard of that host, but it doesn't
seem to be there".

The most likely cause is a temporary failure in your wifi connection,
just as it was trying the DNS lookup. But the DNS server itself could
be to blame, or if it's a DNS server on your site, the connection
upstream, or an upstream DNS server could be to blame.

I use my local wifi server as a DNS server. It's been giving me
problems like this lately, even on wired connections. Plus, it is not
compatible with IPv6, so I'm going to need to upgrade it soon. I could
configure it to advertise OpenDNS servers instead (which is what it
itself is using), but have slightly longer lookups and no cached data
if the cable connection hiccups. If it's the cable connection that's
at fault, then I'll have these problems anyway. It won't be easy to
track down.

On Jan 12, 8:44 pm, Ankur Avlani<[email protected]>  wrote:







Unfortunately, the server is not local.
On Wed, Jan 12, 2011 at 4:15 PM, Dan<[email protected]>  wrote:
Hello All,
I have had this error both on emulator and a Motorola Droid while
using a WIFI connection.  I have surrounded the http request with WIFI
state checks and before and after WIFI is reported state 3
(WIFI_STATE_ENABLED) and a connection speed of 54 . I have also
confirmed, using an adb shell with the emulator, that the emulator
cannot ping the website in question giving a domain resolution error.
To compare notes with Ankur, is the server on your LAN and the IP used
internal? mine is.
I have also tried AndroidHttpClient which does work on the same url.
-Dan
On Jan 12, 12:23 pm, Ankur Avlani<[email protected]>  wrote:
True, I agree with what you say.  Its just that I feel, other apps should
also break or give error.
Anywayz, Thanks a lot for your inputs.
regards,
Ankur.
On Wed, Jan 12, 2011 at 12:17 PM, Brill Pappin<[email protected]>  wrote:
Well i suppose thats possible if your messing with the network stack,
but it's pretty low level for Java/Android.
I guess its also possible that the Android version you have has a
crappy stack or driver... or you have rooted it and have been messing
around under the covers so to speak.
There is nothing in Android really that would allow you to mess it up
that badly AFAIK, so I doubt it's your application causing the problem
if your not specifically getting under the covers.
However, the meaning of the exception is clear:
http://download.oracle.com/javase/1.4.2/docs/api/java/net/UnknownHost.
..
and your app doesn't really control the process of translating a
domain to an ip.
- Brill Pappin
On Jan 12, 2:54 pm, Ankur Avlani<[email protected]>  wrote:
Somehow I have this feeling it is related to my app only.  Other apps
on
the
phone, I don't see any such issue.  Even when browsing on my phone, I
don't
see any error.
On Wed, Jan 12, 2011 at 11:41 AM, Kumar Bibek<[email protected]>
wrote:
By Wi-Fi, I meant, you phone's Wi-Fi could be turning on and off.
There
is
no other reason I can think of. It happens for me as well,
sometimes.
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com
On Thu, Jan 13, 2011 at 1:10 AM, Ankur Avlani<
[email protected]
wrote:
I am sorry, that somehow doesn't convince me.  I am connected to
the
same
wifi on my laptop and i never see any web page load error on my
laptop.
On Wed, Jan 12, 2011 at 11:38 AM, Kumar Bibek<
[email protected]
wrote:
Yup, then it's a problem with your Wi-Fi.
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com
On Thu, Jan 13, 2011 at 1:07 AM, Ankur Avlani<
[email protected]
wrote:
I am connected to network, I am on Wifi.  If i try again it
works.
  Its
just random.
On Wed, Jan 12, 2011 at 11:34 AM, Kumar Bibek<
[email protected]
wrote:
This error/exception comes because of no network connectivity.
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com
On Thu, Jan 13, 2011 at 1:02 AM, Ankur Avlani<
[email protected]>wrote:
Hi All,
I am developing an application on Android.  I have seen that
at
times
when I try to connect using HttpURLConnection, for getting an
Image or
anydata, I get the following error:
01-12 11:24:05.073: WARN/System.err(16780):
java.net.UnknownHostException: Host is unresolved:
www.XXX.com:80.
Note: I get this error on my Motorolla Droid and not in
emulator.
Any ideas?
Thanks,
Ankur
  --
You received this message because you are subscribed to the
Google
Groups "Android Developers" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]<android-developers%2Bunsubs 
[email protected]><android-developers%2Bunsubs
[email protected]><android-developers%2Bunsubs
[email protected]>
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
  --
You received this message because you are subscribed to the
Google
Groups "Android Developers" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]<android-developers%2Bunsubs 
[email protected]><android-developers%2Bunsubs
[email protected]><android-developers%2Bunsubs
[email protected]>
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
  --
You received this message because you are subscribed to the
Google
Groups "Android Developers" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]<android-developers%2Bunsubs 
[email protected]><android-developers%2Bunsubs
[email protected]><android-developers%2Bunsubs
[email protected]>
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
  --
You received this message because you are subscribed to the
Google
Groups "Android Developers" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]<android-developers%2Bunsubs 
[email protected]><android-developers%2Bunsubs
[email protected]><android-developers%2Bunsubs
[email protected]>
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
  --
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]<android-developers%2Bunsubs 
[email protected]><android-developers%2Bunsubs
[email protected]><android-developers%2Bunsubs
[email protected]>
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
  --
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]<android-developers%2Bunsubs 
[email protected]><android-developers%2Bunsubs...
read more »


--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to