Closed shekharkumar86 closed 3 years ago
i have resolve my problem. //using retrofit
val inps = response.body()?.byteStream() var file=File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "${System.currentTimeMillis()}_vacindia.pdf") file.createNewFile() val fos = FileOutputStream(file) var read = 0 val buffer = ByteArray(32768) while (inps?.read(buffer).also { if (it != null) { read = it } }!! > 0) { fos.write(buffer, 0, read) } fos.close() inps?.close()
I am able to get the response from download certificate api but response is binary content data. How can i convert it into pdf file in android. Please help.
/v2/registration/certificate/public/download