commons-app / apps-android-commons

The Wikimedia Commons Android app allows users to upload pictures from their Android phone/tablet to Wikimedia Commons
https://commons-app.github.io/
Apache License 2.0
1.03k stars 1.23k forks source link

Bump target SDK to 34 #5770

Closed sivaraam closed 1 month ago

sivaraam commented 3 months ago

Google has started nudging us to bump our target SDK to API level 34. We have until August 31. After that we won't be able to publish updates unless we bump our target SDK.

Volunteers are welcome to help us with this. We would specifically need to do the required changes verify our functionality doesn't break as a result of bumping the target SDK.

rohit9625 commented 2 months ago

I would like to take this issue. I will upgrade the targetSDK with required changes.

nicolas-raoul commented 2 months ago

@rohit9625 It is yours, thanks! 🙂

rohit9625 commented 2 months ago

@nicolas-raoul @sivaraam
Are you too have this dependency downloading failed problem:- image

When I checked on the link, specified in the dependency. There was no version that our project was trying to download. Please let me know if this is happening only with me or they have removed that version.

kanahia1 commented 2 months ago

@rohit9625, circular progress bar library was only available on the jCenter which has been shutdown now. Due to which you are getting this.

rohit9625 commented 2 months ago

Okay, so should I remove this from the build file?

kanahia1 commented 2 months ago

There are few layouts which are dependent on it, I am working on the possible fix.

rohit9625 commented 2 months ago

Yeah, removing this is resulting in this error: image

Without this I cannot proceed further with my task.

rohit9625 commented 2 months ago

I guess I have to replace this progress bar at many places, like here in activity_quiz_result.xml: image

Did you start working on this or do you have some other stuff to do first?

rohit9625 commented 2 months ago

Hey @nicolas-raoul and @sivaraam, While I was exploring the changes in the new API 34, I found that new permission was added, see this and it can affect the permission handling for Photos in the application.

The custom selector functionality requires full access to images but the user might allow partial access. In this situation:-

  1. We can force the user by prompting to allow full access or
  2. We can configure the custom selector to work perfectly with partial access.

I tried approach 2, and it worked fine with the selected images. However, the problem is that when the user chooses any photo to upload from the another selector and that photo is not allowed by the user to use in the application, it again asks to grant full access. One more thing, we should specify a new UI component in the custom selector or a dialog before launching the custom selector to ask the user if they want to see all pictures or the allowed ones. If we don't do so, then the user can only see the selected images unless they allow full access from the settings manually.

I want to discuss whether should we make use of the new partial access permission or force the user to grant full access to our app(This is easy and does not require significant changes). However, to do this we need to change the implementation of another selector to use Photo Picker.

Apart from that I didn't find any other changes to make in our to adapt to the new API. I checked all code related to new changes and tried building with the new target SDK and the application is working fine.

nicolas-raoul commented 2 months ago

Would you mind trying approach 2? Looking forward to test the PR to see concretely what it entails, thanks a lot! 🙂

nicolas-raoul commented 2 months ago

I want to ask about the Upgrade to SDK 34 PR. Is the current flow of permissions good? At which place does the app require the Location of the photo from the meta-data? When implementing the photo picker(if required), I have to manage this location stuff also.

Permission request should be shown only when needed, in the case of the upload wizard I guess that means when the user clicks Edit location. In that regard, the current workflow of the app is not too bad I believe, but of course any way to improve it is very welcome. :-)

DLEI253636863 commented 1 month ago

Flag of Loei Province https://commons.wikimedia.org/wiki/File%3AFlag_of_Loei_Province.png