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

Linting results and deprecations #10

Open
Penaz91 opened this issue Apr 3, 2024 · 2 comments
Open

Linting results and deprecations #10

Penaz91 opened this issue Apr 3, 2024 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Penaz91
Copy link

Penaz91 commented Apr 3, 2024

During building and testing with Android Studio, I noticed a warning saying that something in the App uses or overrides a deprecated API.

I decided to run the code checking tool and export the result (minus the "typos", which I think are useless at the moment) as an HTML page.

linting_result.zip

This seems like a good starting point for future modernization of the app.

@Vinetos
Copy link
Owner

Vinetos commented Apr 4, 2024

Absolutely. There are bunch of use of deprecated APIs because the app was initially created to target very old Android versions.

A way to automate a linter to at least warn on merge requests can enter in the scope of this issue (probably with a Github Actions but I may deploy jenkins or whatever)

@Vinetos Vinetos added bug Something isn't working good first issue Good for newcomers labels Apr 4, 2024
@Vinetos Vinetos moved this to To triage in First release Apr 4, 2024
@Penaz91
Copy link
Author

Penaz91 commented Apr 4, 2024

Hope you don't mind but I thought it would be a good idea to track some changes here, as a way to jump-start newcomers who would want to contribute to the project.

So here are some deprecation warnings that have been popping up from what I've seen.

androidx.paging.PositionalDataSource
androidx.paging.LivePagedListBuilder
androidx.paging.PagedListAdapter
androidx.paging.PagedList
possibly others
Replaced by PagingSource in Paging v3:
https://developer.android.com/reference/androidx/paging/PositionalDataSource
https://developer.android.com/topic/libraries/architecture/paging/v3-overview
https://developer.android.com/topic/libraries/architecture/paging/v3-migration
https://developer.android.com/topic/libraries/architecture/paging/v3-paged-data

android.os.AsyncTask
Seemingly deprecated with no replacement. Google suggests using either java.util.concurrent.Executors or Kotlin's coroutines

fragment.requestPermissions
Deprecated in favour of the activity result API
https://developer.android.com/reference/androidx/fragment/app/Fragment.html?hl=en#requestPermissions(java.lang.String%5B%5D,int)

android.app.IntentService
Deprecated in API v30 (Android 11) in favour of WorkManager
https://developer.android.com/reference/android/app/IntentService
https://developer.android.com/reference/androidx/work/WorkManager.html

android.telephony.PhoneStateListener
Deprecated in API v31 (Android 12) in favour of TelephonyCallback
https://developer.android.com/reference/android/telephony/PhoneStateListener
https://developer.android.com/reference/android/telephony/TelephonyCallback

fragment.startActivityForResult
Seemingly deprecated in favour of registerForActivityResult.
https://developer.android.com/training/basics/intents/result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
Status: To triage
Development

No branches or pull requests

2 participants