Udi Oshi
Udi Oshi

Reputation: 6867

java.net.UnknownHostException: Unable to resolve host

I know that there were many questiones about this exception but i still can't find the main cause of this exception

It falls in the following line:

HttpResponse httpResponse = httpClient.execute(httpPost);

This is when i'm trying to get XML from web. The xml is from out bank so its free and I used it before (Java swing). Now in ANDROID it throws this exception and I really don't know why.

The xml location is in http://www.bankisrael.gov.il/currency.xml

I will appreciate if someone advice me what can I do and if there are any workaround's.

Thank, Udi

Upvotes: 0

Views: 8663

Answers (1)

RVG
RVG

Reputation: 3576

I've faced same problem., in emulator HttpResponse working. when i execute kindle fire device. HttpResponse not worked. After added the permission its working.

Please make sure have you added permission on manifest file.

<uses-permission android:name="android.permission.INTERNET" />

Upvotes: 2

Related Questions