green-code-initiative / ecoCode-challenge

Emboard in the hackhatons serie for improving ecoCode
3 stars 4 forks source link

[Android] Aging devices: minSdkVersion API level recommendation #40

Open tdeffains opened 1 year ago

tdeffains commented 1 year ago

Aging devices: minSdkVersion API level recommendation

Platform

OS OS version Langage
Android - Gradle

Main caracteristics

ID Title Category Sub-category
- minSdkVersion API level recommendation Environment Aging devices

Severity / Remediation Cost

Severity Remediation Cost
- -

Rule short description

Set application minSdkVersion to high API level will make users' devices obsolete regarding the application.

Rule complete description

Text

As per Android Studio API Version Distribution minimum API Level 21 reaches 99,3% of devices Also Jetpack Compose is now the reference for building UI and requires API Level 21

Android Studio API Version Distribution https://apilevels.com/ https://developer.android.com/jetpack/compose/setup

build.gradle

defaultConfig {
        minSdkVersion 21
}

Implementation principle

olegoaer commented 10 months ago

I agree. Maybe scraping from the https://apilevels.com/ website enable to determine the ideal minSdkVersion

I don't know if embedding a scraping step in a sonar detection rule is commonplace. But let's try!

olegoaer commented 10 months ago

⚠️ Remote calls are harmful for the security level of the plugin. This may prevent it from being validated on the sonar marketplace.