Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #2020
AndroidX is a support library that replaces the depreciated Android support library.
This PR adds a build option
--enable-androidx
which (when used) adds a block tobuild.tmpl.gradle
When AndroidX is enabled, a specific AndroidX library can be added using the existing
gradle_dependencies
option.Some (or all?) of the latest packages in the AndroidX library depend on
api=28
or greater.There is an alternative implementation, setting the same two Gradle flags in a new file named
gradle.properties
. Because of the file management uncertainties introduced in the context ofp4a
, this author will not use this approach.The previous support library is depreciated. There is an argument that AndroidX should be enabled by default. This would impact users who specify an existing support package in
gradle_dependencies
. And there may be some other unforeseen impact. Alternatively AndroidX could be enabled byapi
version, but this would not be transparent to users. I think AndroidX should be enabled by default, but not yet; so it is enabled by build command option.As an example user dependency consider #2200 , it depends on the Android support library but is agnostic to which one. However the user code required does depend on the chosen support library, the change is in a Java class name, and in the name of the
gradle_dependencies
package.The need for #2200 is wide spread; for example the
plyer
camera https://github.com/kivy/plyer/blob/master/plyer/platforms/android/camera.py uses a 'file url' which can no longer be used between Activities, so is not functional with api =29 or greater. To prevent user rework after #2200 is incorporated, I suggest that this PR be incorporated at the same time.