Which Android API Version

Bill Norris

Active Member
Licensed User
Longtime User
The installation documentation for B4A suggests using Android SDK API version 8. Is that still that case or should I use the latest version. Am installing B4A on a new computer.
 

TomA

Active Member
Licensed User
Longtime User
The API version determines the oldest level of Android on which you App will run. Android SDK API version 8 is for Android 2.2 so your App will run on any version of Android from 2.2 up (including the latest version). Choosing an older version of the SDK means that it will run on older versions of Android (e.g. API version 3 will support Android 1.5 and up) while a newer version limits your Apps to later versions (e.g. API version 17 requires Android 4.2 - the latest). If you need something that only appears in later APIs, then you are limiting the range of devices on which the App will run. Version 8 is a good compromise since most Android systems will be running Android 2.2 or later so it makes the App runnable on most systems.
 
Last edited:
Upvote 0

JonPM

Well-Known Member
Licensed User
Longtime User
The API version determines the oldest level of Android on which you App will run. Android SDK API version 8 is for Android 2.2 so your App will run on any version of Android from 2.2 up (including the latest version). Choosing an older version of the SDK means that it will run on older versions of Android (e.g. API version 3 will support Android 1.5 and up) while a newer version limits your Apps to later versions (e.g. API version 17 requires Android 4.2 - the latest). If you need something that only appears in later APIs, then you are limiting the range of devices on which the App will run. Version 8 is a good compromise since most Android systems will be running Android 2.2 or later so it makes the App runnable on most systems.

Not true. Android is backward compatible. You can use the latest API available and it will still work on 1.6. You will only have problems if you use certain features only available on new API. I currently compile my apps using SDK 4.1 (platform 16),
 
Upvote 0

TomA

Active Member
Licensed User
Longtime User
Not true. Android is backward compatible. You can use the latest API available and it will still work on 1.6. You will only have problems if you use certain features only available on new API. I currently compile my apps using SDK 4.1 (platform 16),

Two things about using a later SDK:
1. By using an earlier SDK, it ensures that you will not build an app around some newer feature not supported by the older versions of Android. For example, in android.content.Context, some of the info available to API 17 are not available to API 8.
2. I am not sure of this, but if I produce an app with API 17 and upload it to the Play Store, will it be downloadable to Android devices using earlier releases of Android? Using API 8, it will be.
 
Upvote 0

bluejay

Active Member
Licensed User
Longtime User
Google Store will look at the minSDKversion in your projects manifest (see menu project/manifest editor).

I use Android API 17 with minSdkVersion 4.

This gives you the option to test which version of OS is running and use the new API functions or a fallback as appropriate (eg hardware acceleration vs software rendering).

You always need to check Android docs so you know which functions are not available in API < 17 and program accordingly. Having said that most functions are valid in API 4.

bluejay
 
Upvote 0
Top