I still don't understand compile, Target and MInSdkVersion.

I am ashamed to say that after two years of working in Android, I still can"t tell the difference between these three. After reading a few articles, I am a little uncertain

.

Let me ask you a question:
suppose there is a statement print ("a") in the onCreate method in Api level 23;
suppose onCreate in Api level 24 changes this statement to print ("b");
suppose onCreate in Api level 25 changes this statement to print ("c");

so one of my APK, with a Target version of 24 and compile version of 25 runs on a mobile phone with version 23. Which onCreate method will output?

Thank you first

Feb.28,2021

Portal:

  1. how to choose compileSdkVersion, minSdkVersion and targetSdkVersion
  2. Android targetSdkVersion principle

p.s. The second article gives a very clear example.
p.p.s. The example of the subject is not suitable for targetSdkVersion. The device with system version 23 will never get the result of 24 or 25 (the system is compiled based on 23 code, and the system runs according to 23 code, of course). The question should be: what is the result of compileSdkVersion=25,targetSdkVersion=23, running on 24 devices?


should be print ("a"), Api level 24 level 25 only means that the pair can support so much at most, and the specific operation should be based on the actual situation, just like the folder where Android images are adapted

.
Menu