I need function that download files by passing name and urls, so that i can download series of files in android app.So went ahed and created something like this:\[code\]public void doDownload (String fileName, String url){ File root = android.os.Environment.getExternalStorageDirectory(); File dir = new File (root.getAbsolutePath() + "/Content/"); if(dir.exists()==false) { dir.mkdirs(); } try{ URL fileLink = new URL(url); URLConnection connection = url.openConnection(); connection.connect(); // this will be useful so that you can show a typical 0-100% progress bar int fileLength = connection.getContentLength(); Log.i("ANDRO_ASYNC", "Lenght of file: " + fileLength); // download the file InputStream input = new BufferedInputStream(url.openStream()); OutputStream output = new FileOutputStream(dir + fileName); byte data[] = new byte[1024]; long total = 0; int count; while ((count = input.read(data)) != -1) { total += count; output.write(data, 0, count); } output.flush(); output.close(); input.close(); }catch(Exception e){ } } \[/code\]XML: Added permissionNow when i call this function: \[code\]doDownload(String img.png, String http://server.com);\[/code\]It returns no files. What is wrong here?