Reputation: 45
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.
Upvotes: 1
Views: 2348
Reputation: 225
Add the INTERNET permission to your manifest file. like below
<manifest xlmns:android...> ...
<application android:label="@string/app_name" >...
</application>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>
Upvotes: 0
Reputation: 1607
I had the same problem, by entering the following in AndroidManifest.xml solved it:
<uses-permission android:name="android.permission.INTERNET" />
Upvotes: 2