-1
productFlavors {
    kkandbelow {
        minSdkVersion 19
        targetSdkVersion 19
        applicationId 'bla.bla'
        versionCode 1
        versionName "1.0"
    }
    landabove {
        minSdkVersion 21
        applicationId 'bla.bla'
        versionCode 1
        versionName "1.0"
    }
}

flavor kkandbelow compiled apk is a valid installer file on android-21(marshmallow)? Though the targetSdkversion specified as 19, the apk is still installing on androd 5.0.1 device. Is this behavior expected?

user755
  • 2,521
  • 3
  • 18
  • 29

1 Answers1

0

Is this behavior expected? Yes, it is. You still can apk with lower target sdk version on newer OS versions, it's back compatibility principe.

For more information you can check this.

The only one thing you should be worried about when install old apks on newer versions - it's major security changes, like file system access, runtime permissions, etc. These things could lead to crash and needs to be adopted in code.

A. Shevchuk
  • 2,109
  • 14
  • 23