0% found this document useful (0 votes)
17 views8 pages

Transcript

The document discusses the differences between compile SDK, minimum SDK, and target SDK versions defined in an Android app's build.gradle file. The minimum SDK refers to the oldest Android version the app will run on. The target SDK is the version the app is tested against, and indicates awareness of behavior changes in newer versions. The compile SDK is the version used to compile the app code and determines which new APIs can be used. It is recommended to set all three to the latest possible versions.

Uploaded by

Mayank
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views8 pages

Transcript

The document discusses the differences between compile SDK, minimum SDK, and target SDK versions defined in an Android app's build.gradle file. The minimum SDK refers to the oldest Android version the app will run on. The target SDK is the version the app is tested against, and indicates awareness of behavior changes in newer versions. The compile SDK is the version used to compile the app code and determines which new APIs can be used. It is recommended to set all three to the latest possible versions.

Uploaded by

Mayank
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 8

00:00 hey guys and welcome back to a new video

00:02 lots of beginners learning Android are

00:04 confused about the three SDK versions We

00:06 can Define in our build. gr app file so

00:09 these in particular look like this we

00:11 have compile SDK minimum SDK and Target

00:14 SDK and in this video I will share what

00:16 the differences between these are so you

00:18 can understand that once and for all and

00:20 just a quick reminder when this video

00:22 comes online there is still my big black

00:24 week course discount active but only for

00:26 12 more hours this is really the last

00:28 time the prices for my course will be

00:30 decreased for this year so check them

00:32 out by clicking the first link in this

00:33 video's

00:34 description now let's get back to the

00:37 video before you can really understand

00:39 the differences between compile SDK

00:40 minimum SDK and Target SDK we need to

00:43 understand what this SDK actually means

00:45 because that is what all these versions

00:46 have in common SDK itself just stands

00:49 for software development kit so it's

00:51 really just a toolkit of functionality

00:53 we get from somewhere in this case from

00:55 the Android SDK so the Android software

00:57 development toolkit it really provides

00:59 everything in form of classes and


01:00 functions that we need to build

01:02 functional Android apps and the SDK

01:04 version then refers to the version of

01:06 that Android development toolkit so

01:08 obviously Android develops over time it

01:10 gets more features also how the

01:12 operating system itself Works changes in

01:15 each set of these changes then just gets

01:17 its own version we can also take a look

01:19 here by clicking on the settings icon in

01:21 the top right opening this SDK manager

01:24 here we can now see which Android

01:26 version that the public knows for

01:28 example Oreo or pi relates to which API

01:31 level so this API level number is just

01:33 this SDK version we just saw in our

01:35 grade file so it's really just like an

01:37 internal number for an Android version

01:40 and when it now comes to the differences

01:42 between these three versions because

01:43 they all sound kind of similar or at

01:45 least don't really reveal what these are

01:47 for maybe only minimum SDK but compile

01:51 SDK and Target SDK aren't as clear so

01:53 let's dive into them and let's start

01:55 with minimum s because as I said that is

01:57 the easiest to understand this just

01:59 refers to to the minimum Android API

02:01 level your app can run on currently this


02:04 is set to 24 which relates to Android

02:06 nougat or Android 7 and the more you

02:08 increase this version the less Android

02:11 versions your app finally supports the

02:13 advantage is of course that you need to

02:15 deal with much less compatibility issues

02:17 because you say your app should only be

02:20 able to run on this little group of

02:21 Android versions however if you decrease

02:23 this version that means your app could

02:25 potentially run on a lot more Android

02:27 versions and therefore more users could

02:29 install it but on the other hand you

02:31 need to deal with much more

02:32 compatibility issues most apps nowadays

02:35 set this to 21 24 or 26 with that you

02:39 really Target a broad range of android

02:40 devices which is probably 90 to 95% of

02:44 all devices let's next talk about the

02:46 target SDK because that isn't as clear

02:48 as the minimum SDK the target SDK refers

02:52 to the API level version that you've

02:54 tested your app against so from time to

02:56 time there are just certain Behavior

02:58 changes in Android and if there are such

03:00 Behavior changes you can set the target

03:02 SDK version to these corresponding

03:04 versions where these Behavior changes

03:06 were introduced to indicate that you

03:08 aware of these changes and you've tested


03:10 your app against these one example of

03:11 this was for example the introduction of

03:13 scope storage which was just a very

03:15 major file storage revamp of Android so

03:18 how file access worked especially when

03:21 it comes to the shared storage section

03:22 of Android where multiple apps could

03:24 access that and of course migrating a

03:26 big app from the old storage system to

03:28 this new scoped storage system isn't

03:30 something that happens in a day

03:31 therefore when that was introduced you

03:33 could use the target SDK version and set

03:35 it to a version before that storage

03:38 revamp because that says you are not yet

03:40 aware of these Behavior changes or you

03:42 at least did not test your app against

03:44 these yet but as soon as you then

03:45 migrate your app to these new changes

03:48 you can then increase the target SDK to

03:50 say hey we prepared our app for these

03:52 changes and we're now aware of these and

03:54 therefore also want to apply these new

03:56 Behavior changes to our app however

03:58 usually these Behavior changes just mean

04:00 deprecations and more complex

04:02 restrictions for us developers I mean in

04:04 the end they achieve some form of better

04:06 security for the users but usually they


04:08 are a pain for us developers so why not

04:11 just take the target SDK and leave it at

04:13 a very low version like 26 for example

04:16 so we don't have to deal with all these

04:18 modern Android restrictions such as

04:19 scope storage which is really just a

04:21 pain to deal with and technically you

04:23 can do that you can set the target SDK

04:25 to 26 you therefore don't have all these

04:27 restrictions and you can still use the

04:29 most modern apis on Android however the

04:31 biggest problem is that you won't be

04:33 able to publish your app on Google Play

04:35 that way so you can see we get a warning

04:36 here if we hover over that you can see

04:38 Google play requires that app's Target

04:40 API level 31 or higher so Google still

04:43 kind of controls what you have to set

04:45 for that but technically if you would

04:47 reduce this version to something like 26

04:49 or even lower your app would just behave

04:51 fine on Android devices if you manually

04:53 install it or install it via a different

04:56 Play Store or different app store but if

04:58 you plan on getting an actual user base

05:00 that is of course not the best option so

05:03 you want to keep this as something like

05:05 the latest version so let's now come to

05:06 the last version which is the compile

05:08 SDK version which is also set to 34 so


05:11 what does that now mean the compile SDK

05:13 as the name has defines which API level

05:17 of the Android SDK you are compiling

05:19 your app with this version can be lower

05:21 than the target SDK version so if we set

05:23 this to 33 you will see we get an error

05:25 that this can't be lower than 34 the

05:28 other way around that works very well as

05:30 we just saw so this target SDK version

05:32 can be lower as the compile SDK while

05:34 the target SDK more refers to behavior

05:37 the compile SDK refers to the actual

05:40 technical apis that we can use in our

05:42 code so for example in Android 10 Dark

05:44 theme was introduced at least with the

05:46 system toggle and if we would now go

05:48 ahead and change this compile SDK

05:50 version to a version below Android 10

05:53 something like I don't know 24 for

05:54 example which is Android 7 then that

05:56 means we could not use that new feature

05:58 of dark theme in our app because we say

06:01 we compile our app with an Android

06:03 version below that version 10 and since

06:05 the set of functionalities for the for

06:07 the Dark theme was introduced in Android

06:08 10 we won't get that if we compile it

06:11 with a previous SDK you'll also see that

06:13 if we for example increase this back to


06:15 um let's let's do 33 or just something

06:18 lower it doesn't matter and we change

06:20 the compile SDK to something like 28 or

06:23 so we then synchronize this and then

06:26 check in our UI package theme for

06:29 example

06:30 then we should maybe see some changes

06:32 here oops I actually changed this back

06:34 but here build version codes S is of

06:36 course not recognized anymore because

06:39 this version reference or this um field

06:41 of the version codes S was introduced

06:44 with version s of course so we can't

06:46 refer to that if we compile our app with

06:49 a version that was before Android s if

06:51 we set this back to 34 that means we

06:54 want to use all the latest Technical

06:56 apis and we sync this then you will see

06:58 that now as is recognized because when

07:02 if we take a look at what 34 is actually

07:05 what kind of version that is 34 is

07:07 upside down cake so Android 14 and

07:09 Android s was Android 12 which is API

07:12 level 31 then now we of course compiled

07:14 our app with 34 which is above 31 so we

07:17 can also refer to that field which was

07:20 introduced in Android s so you can

07:22 really think of this compile SDK field

07:24 like a time machine if you reduce this

07:25 field then your app kind of thinks that


07:27 it is running in the past where the

07:28 Android SDK just wasn't as advanced as

07:31 it is now usually you just want to keep

07:32 this at the latest version possible

07:34 which is 34 at the moment and we also

07:36 want to change back the target isk to 34

07:39 so we don't get any issues with Google

07:41 Play so I hope that clarified the

07:43 differences between these versions a

07:44 little bit if you enjoy that then you

07:45 will definitely also enjoy my more

07:47 advanced Android premium courses again

07:49 there is still a big discount for only

07:50 12 more hours when this video comes

07:52 online check the first link down below

07:54 and other than that thanks so much for

07:55 watching I will see you back in the next

07:56 one have an amazing rest of your week

07:58 bye-bye

You might also like