MinSdk and Target Sdk

2,618 views
Skip to first unread message

Kelechi Ekezie

unread,
Oct 23, 2021, 8:40:44 AM10/23/21
to DroidScript
Hello everyone, how can I know the minSdk and target Sdk to set for my app
Regards, ah

Alan Hendry

unread,
Oct 23, 2021, 9:59:59 AM10/23/21
to DroidScript
Hi,
has a list of API levels for different versions of Android
Regards, ah

Kelechi Ekezie

unread,
Oct 25, 2021, 4:00:39 AM10/25/21
to DroidScript
That is not what i mean 
I set my minSdk to 21 which is android 5 and my target sdk to 29 which is android 10
But how do i know if to set my minSdk to 21 or below or above or my target sdk to 29 or below or above 
Regards, ah.

Steve Garman

unread,
Oct 25, 2021, 4:25:52 AM10/25/21
to DroidScript
Normally the advice is not to have a build.json file in your app at all unless you have a good reason to
DroidScript will then use values appropriate for the current version of DroidScript

However Google Play is not currently allowing uploads with targetSdkVersion set lower than 30 but the current version of DroidScript sets targetSdkVersion to 29

If you absolutely must update a current app on Google Play before the new version of DroidScript is available you could try using a single manifest entry

{
  "manifest": {
    "targetSdkVersion": 30

Steve Garman

unread,
Oct 25, 2021, 4:32:58 AM10/25/21
to DroidScript
Sorry I forgot to includebthe direct answer to your question

The only likely reason to change either value is if you know or suspect that your app does not work correctly outside the normal range
Message has been deleted

Kelechi Ekezie

unread,
Oct 26, 2021, 8:50:49 AM10/26/21
to DroidScript
Kelechi Ekezie
unread,
13:48 (2 minutes ago) 
to DroidScript
That is my main question
How do i know if my app wont work correctly outside the normal range
Do i have to go testing in all versions of android?

Steve Garman

unread,
Oct 26, 2021, 8:59:22 AM10/26/21
to DroidScript

That's right

A lot of features will not work outside the normal range because they are no longer tested on old devices so you need to assume they are not supported

If you want to target your app to older devices you will need to test it thoroughly on samples of those devices

Alan Hendry

unread,
Oct 26, 2021, 10:08:39 AM10/26/21
to DroidScript
Hi,

The min sdk version is the minimum version of Android required to run your application. 
The target sdk version is the version of Android that your app was created to run on.
Technically each version of Android has a new SDK (Software Development Kit) 
and if you code using Java/Kotlin (using Android Studio or similar) 
then you would use a specific SDK, 
particularly if you use any objects/methods that were added (or deprecated) at specific versions.

If your user is using very very old Android then some code may not be supported 
(for example Gyroscopes and multiple cameras were not supported before Gingerbread).
Your code can do checks like sensor ListNames, and GetCameraCount.
You probably don't need to worry if your code is written in DS, 
but if you use a plugin (like fingerprint sensor - added in Marshmallow) it may be worth checking.

Regards, ah

Kelechi Ekezie

unread,
Oct 27, 2021, 5:42:43 AM10/27/21
to DroidScript
Thanks a lot, i get it now
Reply all
Reply to author
Forward
0 new messages