Well, this is a simple task, you need to use the WRITE_EXTERNAL_STORAGE permission .. then just get an InputStream
InputStream is = response.getEntity().getContent();
Create FileOutputStream
FileOutputStream fos = new FileOutputStream(new File(Environment.getExternalStorageDirectory(), "test.epub")) ;
and read from is and write using fos
int read = 0; byte[] buffer = new byte[32768]; while( (read = is.read(buffer)) > 0) { fos.write(buffer, 0, read); } fos.close(); is.close();
Change, check for tyoo
source share