Pdf-Viewer
Pdf-Viewer copied to clipboard
File Copy Implementation
Code Refinements:
- The PdfViewerActivity now includes a more refined permission check for
WRITE_EXTERNAL_STORAGE, taking into account the different API levels and their permission models. This is critical for Android 6.0 (Marshmallow) and above, where runtime permissions are required. - Enhanced file handling with FileUtils, which includes a new method for copying files,
copyFile(..). This addresses a need to manipulate files within the app's scope effectively, following best practices for file storage. - The
downloadFile(..)function has been improved to use Environment.getExternalStoragePublicDirectory(), which is a more standardized way to access shared storage in a manner consistent with Android's scoped storage model.
Code Cleanup:
- Removed unnecessary imports, which cleans up the codebase and possibly improves build time and performance.
- Streamlined the code by removing redundant calls and ensuring that the app's behavior aligns with the expected permissions flow, especially around storage access which has been a point of significant change in recent Android versions.
Gradle Updates:
- Upgraded the targetSdkVersion to 33, preparing the app for the latest Android OS compatibility.
- Replaced the deprecated android.support:multidex with androidx.multidex:multidex, aligning with AndroidX migration.
- Updated various dependencies to their latest versions, including Kotlin, JUnit, and Espresso. This ensures that the app is using the most up-to-date libraries, which often include important bug fixes and performance improvements.
Manifest Adjustments:
- Made changes to the AndroidManifest.xml file, which could include updating the permissions, activity declarations, or adjusting the application's metadata.
Visual Assets:
- Lowered the size of the image files.
Can you please add the reason why did you add copyFile method in the description?
You need merge this PR. As it's handle write external storage permission above Android 11 @afreakyelf
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.