Pdf-Viewer icon indicating copy to clipboard operation
Pdf-Viewer copied to clipboard

File Copy Implementation

Open rtsketo opened this issue 2 years ago • 4 comments

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.

rtsketo avatar Feb 20 '23 15:02 rtsketo

Can you please add the reason why did you add copyFile method in the description?

afreakyelf avatar Feb 22 '23 19:02 afreakyelf

You need merge this PR. As it's handle write external storage permission above Android 11 @afreakyelf

hiteshsarsava avatar Dec 01 '23 07:12 hiteshsarsava

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.

github-actions[bot] avatar Jan 01 '24 02:01 github-actions[bot]

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.

github-actions[bot] avatar May 20 '24 02:05 github-actions[bot]