Skip to content

Document a pattern to replace @RequiresApi #1590

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

Open
stuartmorgan-g opened this issue Sep 23, 2024 · 1 comment
Open

Document a pattern to replace @RequiresApi #1590

stuartmorgan-g opened this issue Sep 23, 2024 · 1 comment

Comments

@stuartmorgan-g
Copy link

A common pattern in Android development is use (and define) methods that require a specific Android API version at runtime, indicated with the @RequiresApi annotation. There are then warnings at development time if those methods are used in an application that has a lower allowed runtime level without the calls being gated on appropriate runtime checks (e.g., a Build.VERSION check, or being in a method that is itself annotated @RequiresApi with as high or higher an API).

Ideally we would want a solution that provides a similar level of linter/analyzer-based checking, otherwise a very common class of issues will move from being easily found at development time (authoring in Java) to only being found when testing that specific codepath on a sufficiently old device/emulator, which is dramatically worse as a developer (and if something goes wrong as a result, end user) experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant