I'm trying to download a csv file from a website and am using the following code for that:
URL url = new URL(link);
URLConnection urlConnection = url.openConnection();
FileReader file = new FileReader((File) urlConnection.getContent());
CSVReader csvReader = new CSVReader (file);
But when I try to run this in the emulator it throws a Socket Exception. All searches I did for this exception said add the permission to use the internet in the manifest file. However even after doing that I still get the same error. I'm wondering if there is something in the emulator settings that might be needed to be changed. Because in my emulator the wifi connection is not highlighted.
Appreciate any help!
here is the error log that shows me that there is Wi-Fi driver failure on the emulator
05-20 15:37:32.065: ERROR/WifiService(57): Failed to load Wi-Fi driver.
05-20 15:37:33.245: ERROR/WifiService(57): Failed to load Wi-Fi driver.
05-20 15:37:34.145: ERROR/WifiService(57): Failed to load Wi-Fi driver.