I\'ve run into a wall with my program on this one. I\'ve searched around the internet for a solution to this problem but I haven\'t been able to find one so here goes..
Yeah. You're not actually copying the file.
public void downloadFile(String file_name) throws IOException {
URL url = new URL(file_url + file_name);
URLConnection connection = url.openConnection();
InputStream response = connection.getInputStream();
FileOutputStream fos = new FileOutputStream(local_file_path + file_name);
byte data[] = new byte[1024];
//WHERE'S THE BEEF?
fos.write(data);
fos.close();
response.close();
}
Also, manually writing that copy code is error prone. I made a trimmed down version of apache commons:
http://www.touchlab.co/blog/android-mini-commons/
Call
IOUtils.copy(response, fos);