Skip to content
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

Added support for Android 16. #4231

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

Added support for Android 16. #4231

wants to merge 12 commits into from

Conversation

MohitMaliFtechiz
Copy link
Collaborator

@MohitMaliFtechiz MohitMaliFtechiz commented Feb 19, 2025

Fixes #4165

  • Added support for Android 16.
  • Upgraded AGP to 8.11.0-alpha03, which supports Android 16.
  • Upgraded the Gradle wrapper to 8.13, the latest version.
  • Refactored the java.util.Locale constructor, which is deprecated in Android 16. For this, we have created CompatV36 to utilize the methods introduced in this Android version.
  • After upgrading the gradle lint showed some new errors so we have fixed those lint errors that required us to use the KTX extension functions, as they internally utilize the same functions we were using.
  • Fixed: AnnotateVersionCheck lint error.
  • Upgraded the com.googlecode.json-simple to version 1.1.1.
  • Upgraded the com.squareup.okhttp3:okhttp to version 4.12.0.
  • Upgraded the org.jetbrains.kotlinx:kotlinx-coroutines-rx3 to version 1.10.1.
  • Upgraded the androidx.test:orchestrator to version 1.5.1.
  • Upgraded the androidx.constraintlayout:constraintlayout to version 2.2.0.
  • Fixed: Some deprecated methods in the custom app's Gradle. The new methods for registering tasks are better than the previous ones, which is why Gradle deprecated the older methods.

@MohitMaliFtechiz
Copy link
Collaborator Author

@kelson42 The code refactoring is complete, and all functionalities are working fine on Android 16. However, we need to wait for some time as there are no sources available for Android 16 yet. Since it is in preview, we have added targetSdkPreview to run it on Android 16. As a result, our application will not run on other Android devices (which is why all our CI tests are failing) because it is using the preview SDK.

Screenshot from 2025-02-20 14-45-03

@kelson42
Copy link
Collaborator

Still no sources available?

@MohitMaliFtechiz
Copy link
Collaborator Author

@kelson42 Yeah, recently, resources have been updated for Android 16. I will rebase this PR, and mark this ready for review.

image

@kelson42
Copy link
Collaborator

@MohitMaliFtechiz Please don't forget to rebase

…droid 16.

* Replaced the  and  with , and  to add support for Android 16.
…ndroid 16. * Created to utilize the methods introduced in this Android version. * Upgraded AGP to , which supports Android 16. * Replaced targetSdkVersion and compileSdkVersion with targetSdkPreview and compileSdkPreview to add support for Android 16. * After upgrading the gradle lint showing some new errors so we have fixed those lint errors that required us to use the KTX extension functions, as they internally utilize the same functions we were using.
…the com.squareup.okhttp3:okhttp to version 4.12.0. * Fixed remaining deprecated object.
…n `1.10.1`.

* Upgraded the `androidx.test:orchestrator` to version `1.5.1`.
* Upgraded the `androidx.constraintlayout:constraintlayout` to version `2.2.0`.
* Fixed the last lint issue.
…stylus_handwriting_enabled setting being enabled by default, which displays a hint dialog when a text field takes focus.
… itself, which was preventing us from merging or excluding duplicate META-INF files.

* Upgraded Gradle to `8.11.0-alpha03` for better support for Android 16.
* Upgraded the Gradle wrapper to `8.13`, the latest version.
* Fixed: Some deprecated methods in the custom app's Gradle. The new methods for registering tasks are better than the previous ones, which is why Gradle deprecated the older methods.
* Refactored the `createDynamically` task for custom apps according to new gradle.
* Fixed: Some lint and detekt issues.
Copy link

codecov bot commented Mar 31, 2025

Codecov Report

Attention: Patch coverage is 66.03774% with 18 lines in your changes missing coverage. Please review.

Project coverage is 58.98%. Comparing base (eeba4ef) to head (01df6fe).

Files with missing lines Patch % Lines
...ava/org/kiwix/kiwixmobile/core/compat/CompatV36.kt 0.00% 7 Missing ⚠️
...x/kiwixmobile/core/extensions/ContextExtensions.kt 0.00% 3 Missing ⚠️
.../org/kiwix/kiwixmobile/core/compat/CompatHelper.kt 33.33% 0 Missing and 2 partials ⚠️
...ava/org/kiwix/kiwixmobile/core/compat/CompatV33.kt 0.00% 2 Missing ⚠️
.../destination/library/local/LocalLibraryFragment.kt 88.88% 0 Missing and 1 partial ⚠️
...ix/kiwixmobile/core/dao/entities/LanguageEntity.kt 50.00% 0 Missing and 1 partial ⚠️
.../kiwix/kiwixmobile/core/main/CoreReaderFragment.kt 75.00% 0 Missing and 1 partial ⚠️
...wix/kiwixmobile/core/settings/CorePrefsFragment.kt 66.66% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (66.03%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4231      +/-   ##
============================================
- Coverage     59.75%   58.98%   -0.78%     
+ Complexity     1644     1602      -42     
============================================
  Files           340      340              
  Lines         14977    14972       -5     
  Branches       1885     1886       +1     
============================================
- Hits           8950     8831     -119     
- Misses         4715     4846     +131     
+ Partials       1312     1295      -17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…g on Android 16.

* Removed some unused code from project.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support of Android 16
3 participants