New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated targetSdkVersion and compileSdkVersion to 30 and Migrated from Support Library to AndroidX. #994
Conversation
area:build.gradle -> Gradle version updated area:gradle.properties ->replaced android.enableR8=true to android.enabledD8=true area:gradle\wrapper\gradle-wrapper.properties ->Updated gradle version
->Changed the UI design of navigation drawer ->Changed Navigation Icon
…m Support library to AndroidX.
Code Climate has analyzed commit 1b82c4f and detected 0 issues on this pull request. View more on Code Climate. |
This have same problem which i told you earlier, it does not create PDF only application works fine but doesn't create pdf. |
Actually I am not understanding the exact problem when you say 'it does not create pdf only app work fine'. Please confirm step by step :
|
Yes we can select image and image get selected Green tick also appear after processing Open PDF also appear After clicking view pdf it doesn't work showing error. PDF is not saved on storage |
I need more detailed understanding of this project to solve this scope storage issue to make it compatible with api 29+. SideNote~ |
Hey Archit, can you try changing the default storage location to some place
else?
It can be done in the settings tab.
On Fri, 26 Mar 2021 at 7:16 PM, Archit Raut ***@***.***> wrote:
Same problem after clearing data
[image: image]
<https://user-images.githubusercontent.com/47945979/112640832-bc7cc000-8e67-11eb-9faf-94307d77aefc.png>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#994 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACF5NPMF3BZLF2V45UD32FTTFSF4TANCNFSM4ZZAESZQ>
.
--
Swati Garg Netaji Subhas Institute of Technology (+91-9971604989)
|
Hey Swati 👋, |
Yes same problem here, but we are giving storage permission why it required additional permission? |
Please make it clear, this is not additional permission. I'm telling you why it is not additional permission -
And this documentation states
Kindly continue asking about it, until your every doubts are cleared :) |
Thank you @codegsaini I understand that. Can you check #989 here @AvneeshGupta1 has added his Repository link where he had converted this code to kotlin and updated target SDK also but in that project, there is no such error, pdf get created properly. |
Actually, I forgot to mention that You can temporarily solve the issue by As you can see in below image app must target to API 30 before november 2021 ScreenShot from PlayConsoleHelp which states that - |
Ohhh you are right, we should find solution for this |
Yup, I'm working on it... |
@codegsaini - Any updates here? |
I'm sorry to say that I postponed the work due to personal reasons ( exams are ahead ). But for sure, I will figure out the solution before the google deadline of updating target SDK version. I will begin working on it as soon as my exams are over. Is it fine or should I give it time amid exams preparation? |
Not a problem... I'm okay with your late reply and here to tell you that, I started working on it again and will be back with the solution soon(a day or two maybe). |
It's very simple. We can not create folder on root directory but inside app we have created PdfFiles folder. This will work. i will update the code in my branch today. |
Hey Avneesh, Your welcome for mentioning it. Working on something same concept though, most probably tomorrow I'll be back here with a solution. Good luck for your update, Cheers... |
As android has some public directories (i.e Alarm, DCIM, Downloads, Documents, Pictures, etc.), it allows app to save files in related public directory. And we can get the path of these public directories by
Because the app using
So, undoubtedly this solution is still not future proof, As android can remove deprecated methods anytime.What is the solution then? (Good question)I'll be back with the solution after going through the android documentations and some (re)search on google. (Edit 1)Update so far-- |
The storage permission was removed by mistake in commit a5b916a and now it is implemented again.
I will submit another pull request after solving issue #996. Until then you can merge this pull request. Although there are so many changes in the this pull request, You can ask me about any change in particular. |
@codegsaini I was occupied somewhere for last couple of weeks. This PR looks good. I'll merge this one :) |
I have checked and test the recent commit, Creating a PDF file is working perfectly but facing an issue in Add Password, Merge PDF, Add Text, and others, Like showing "we are unable to access the file at this location" after selecting PDF file. |
@Ravipatel401 While testing in Redmi 6A (API 28), the issue is never produced. I'm assuming that this issue is on API 29+. After testing on emulator with API 29+ I'll start working on it. TL;DRI'll be working on this issue soon. |
@codegsaini Thank you so much for your response, I am creating a new issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not Solve Android 10 And 10+ Not Working
@codegsaini Not Working Android 10 And 10+ Not Working |
As per Google Play’s target API level requirements, which states that -
It is necessary to change
targetSdkVersion
from28
to29
or higher.The first problem to do this :
Version 28 (intended for Android Pie and below) is the last version of the legacy support library. Because this project ( the app ) is using support library. It is the initial problem in order to update
targetSdkVersion
.The solution for this initial problem :
As per Support Library Documentation, which states that -
So, the project should be migrated from Support Library to AndroidX.
Is this solution enough?
As issue #973 and #989 comments that Image To PDF feature was stopped working after changing
targetSdkVersion
from28
to29
, further work was to be done to resolves these mentioned issues.Resolution of Issues #973 and #989 :
The problem is due to scoped storage concept of Google's new storage policy!
Problem?
As Google's new storage policy states that -
What is scoped storage?
Scoped storage as its name suggest, it is the specific storage path or specific folder that user have chosen to save any data, files, etc.
Why google Introduced this storage policy?
When
WRITE_EXTERNAL_STORAGE
permission is granted by user then the app get full access to the entire storage. It can do anything with any file in the storage ( except other app's private storage ). And by this behaviour, you can understand how danger this permission is if given to any bad app.What exactly this policy say?
Now, in API 29+, even if user granted
WRITE_EXTERNAL_STORAGE
permission, the app still not granted write access. Rather when the app wanted to write anything in the storage, the user will specifically have to choose a specific directory to save the file. It means app can't do anything with the storage without user's consent (neither can create folder nor can delete any).What changed, Before policy vs After policy?
WRITE_EXTERNAL_STORAGE
permission can do anything with storage.WRITE_EXTERNAL_STORAGE
permission, can't do anything until user choose to give the permission to specific folder (SPECIFIC FOLDER NOT ENTIRE STORAGE).More information at developer.android.com.
Thus, implementing scoped storage method to save pdf or images to storage will fix #973 , fix #989
Type of change
targetSdkVersion
updated to satisfy Google Play’s target API level requirementscompileSdkVersion
updated as wellHow Has This Been Tested?
./gradlew assembleDebug assembleRelease
./gradlew checkstyle
Successfully tested on :
Checklist:
Updated README.md
Additional note
Closed #975 (redundant issue), because it is not closed by issue opener even after being resolved.
A note on resolution of scoped storage issue
READ_EXTERNAL_STORAGE
permission.