I would like to know how to get the filename from the URL so that it could download into SDCARD without overwriting the new files.
int lenghtOfFile = conexion.getContentLength();
Log.d("ANDRO_ASYNC", "Lenght of file: " + lenghtOfFile);
String fileName = "test.epub";
InputStream input = new BufferedInputStream(url.openStream());
OutputStream output = new FileOutputStream("/sdcard/"+ fileName);
writing the data to sdcard
Create a unique id with using random for name of the each file.