android-rs-glue icon indicating copy to clipboard operation
android-rs-glue copied to clipboard

Rename SDK version config labels

Open mb64 opened this issue 5 years ago • 2 comments

This was discussed a little in #223.

It would be great to rename android_version, min_sdk_version, and target_sdk_version to a more coherent naming scheme. Some options could be:

  • build_sdk_version, min_sdk_version, target_sdk_version
  • build_android_version, min_android_version, target_android_version
  • android_platform, min_android_platform, target_android_platform

However, this is very much a breaking change, so it merits some discussion.

mb64 avatar Jul 30 '19 18:07 mb64

I would like to suggest compile_sdk_version, min_sdk_version, and target_sdk_version.

The meaning of the settings directly correspond with the compileSdkVersion, minSdkVersion, and targetSdkVersion when working with gradle and Android.

It is a breaking change but one of which I'm personally in favor. Should we handle the compatibility issues with just a note in the README or is it something that should be deprecated before being removed?

philip-alldredge avatar Jul 30 '19 21:07 philip-alldredge

After learning a bit more about how things work, I am no longer sure of the suitability of renaming android_version to compile_sdk_version.

When building a java application the compileSdkVersion affects what Java android APIs can be used. It is expected that an application will work under versions of android indicated by minSdkVersion by handling differences gracefully.

NDK applications should always build using the minSdkVersion. The discussion of APP_PLATFORM at https://developer.android.com/ndk/guides/application_mk makes that clear. The reasoning is that if your binary refers to any missing symbols, it will fail to load. There could also be compiler flag differences.

min_sdk_version corresponds to the minSdkVersion in the android manifest. It also determines the NDK tools used to build. target_sdk_version corresponds to the targetSdkVersion in the android manifest. android_version controls the platform version of the android.jar used when building the APK. I'm not sure what effect this has other than determining what attributes in the android namespace can be used in the manifest.

In general I like min_sdk_version and target_sdk_versions because those directly map to values in the android manifest. android_version may correspond to compileSdkVersion when using the gradle build system but the name gives user the impression is affects compilation. Perhaps that is why it was originally named android_version?

In short, I'm no longer sure about a suitable name or whether it should even be renamed.

philip-alldredge avatar Aug 06 '19 00:08 philip-alldredge