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.24k forks source link

Migration of Java Code to Kotlin for Enhanced Code Consistency and Maintainability #5928

Open Saifuddin53 opened 2 days ago

Saifuddin53 commented 2 days ago

What is the user problem or growth opportunity you want to see solved?

The current codebase consists of a mix of Java and Kotlin, which introduces inconsistencies and can make the code harder to maintain and extend. Migrating fully to Kotlin would streamline the code, reduce verbosity, and provide a more cohesive developer experience. This transition would also open up future opportunities to leverage Kotlin Multiplatform (KMP), facilitating easier expansion to iOS if desired.

How do you know that this problem exists today? Why is this important?

Android development is increasingly Kotlin-centric, as it’s the recommended language with strong support for modern Android features, readability, and efficiency improvements. Having a consistent codebase fully in Kotlin will improve maintainability and simplify onboarding.

Who will benefit from it?

Anything else you would like to add?

Once the migration to Kotlin is complete, further modernization could include adopting Jetpack Compose for the UI layer, reducing XML dependency, and simplifying the UI structure. This approach would prepare the project for KMP, creating a strong foundation for potential iOS app development in the future.

misaochan commented 20 hours ago

I agree wholeheartedly with your points, and we started the process several years ago. It will take a long time and quite a lot of work, however, as it involves rewriting large portions of the app. Would you be interested in working on this, @Saifuddin53 ?

Saifuddin53 commented 19 hours ago

Yes @misaochan @nicolas-raoul, I'm interested in contributing to this migration process.

I plan to start with the utility/helper classes, as they are more isolated and easier to migrate. After completing that, I’ll adopt a module-wise approach, focusing on one module at a time to ensure smooth transitions and minimal disruptions.

Alternatively, if needed, I can prioritize specific areas, such as the data layer or UI components. Since this involves a large amount of work, anyone interested in joining the migration process is more than welcome to collaborate. It would be great to share the workload and move faster while ensuring high-quality results.

misaochan commented 19 hours ago

That sounds great, thank you very much. :) I'll assign you to this @Saifuddin53 , but if anyone else is interested, please feel free to chime in. Unlike other issues, I think it should be fine for multiple people to work on this one, as it is a huge task. We can probably add a checklist later to track the PRs as they come in.

Saifuddin53 commented 19 hours ago

Thank you so much for assigning me to this, @misaochan

Also, for anyone who’d like to join this migration effort:

  1. Check if someone is already working on the file/module you’re interested in. This can be done by looking at the existing issues or PRs related to the migration.

  2. Create a ticket/issue for the files or modules you’re taking on, if no one is already working on them. In the ticket:

    • Mention the parent migration ticket.
    • Specify the files/modules you plan to work on.

This approach will help us stay coordinated and avoid overlaps.