Posts

Showing posts with the label How to download PDF from byte array or byte stream - Android

How to download PDF from byte array or byte stream - Android

How to download PDF from byte array or byte stream - Android We can download easily pdf from byte stream, for that one have to follow some necessary steps. Step 1 : Have to give read and write external storage permission in AndroidMenifest.xml file : < uses-permission android:name = "android.permission.READ_EXTERNAL_STORAGE" /> < uses-permission android:name = "android.permission.WRITE_EXTERNAL_STORAGE" /> Step 2 : The main problem is though we gave permission but in higher android version need to give permission manually form Application settings. This is to much annoyed for any non-technical users because they want their PDF but they will not take this hassles. So we have to do this from program where user will notify he/she wants to give permission or not. This way - public static boolean isStoragePermissionGranted (Activity activity) { if (Build.VERSION.SDK_INT >= 23 ) { if (ContextCompat.checkSelfPermission...