I am attempting to use a yahoo finance api that returns a stock quote as a cvs file in Android. I've reduced the code down to:

HttpClient httpClient = new DefaultHttpClient();
HttpContext localContext = new BasicHttpContext();
HttpGet httpGet = new HttpGet("http://download.finance.yahoo.com/d/quotes.csv?s=msft&f=sl1p2");

I'm getting the following error "java.net.UnknownHostException: download.finance.yahoo.com"

The link works so I'm not sure why I'm getting the exception. Any help is appreciated.

share|improve this question
If you're running this in the emulator, try restarting it. I get this problem very often. Also, if you're using a Mac, you might need to configure the interfaces. – dmon Jun 5 '11 at 5:27
Thanks, however, I'm using a phone and not an emulator. – PonziCoder Jun 5 '11 at 5:29
1  
For what it's worth after hours of looking at it, I had my permissions in the wrong place in the manifest.xml. – PonziCoder Jun 5 '11 at 21:08
feedback

1 Answer

I had the same problem, by entering the following in AndroidManifest.xml solved it:

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

share|improve this answer
feedback

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.