Questions tagged [android-api-levels]

Each Android version is assigned a unique integer identifier, called the API Level.

As the Android platform evolves and new Android versions are released, each Android version is assigned a unique integer identifier, called the API Level. Because users install apps on older as well as the most recent versions of Android, real-world Android apps must be designed to work with multiple Android API levels.

Each release of Android goes by multiple names:

  • The Android version, such as Android 4.4
  • The API level, such as "API Level 19"
  • A dessert name, such as "KitKat"

Each Android device supports exactly one API level – this API level is guaranteed to be unique per Android platform version. The API level exactly identifies the version of the libraries that your app can call into; it identifies the combination of manifest elements, permissions, etc. that you code against as a developer. Android's system of API levels helps Android determine whether an application is compatible with an Android system image prior to installing the application on a device. When an application is built, it contains the following API level information:

  • The target API level of Android that the app is built to run on.
  • The minimum API level of Android that is required to run the app.

These settings are used to ensure that the functionality needed to run the app correctly is available on the Android device at installation time. If not, the app is blocked from running on that device. For example, if the API level of an Android device is lower than the minimum API level that you specify for your app, the Android device will prevent the user from installing your app.

Source: https://developer.xamarin.com/guides/android/application_fundamentals/understanding_android_api_levels/

324 questions
5
votes
3 answers

Why is android activity action bar title black?

When I made projects using Android Studio before, the activity action bar title was white by default. I created a new project with same settings as the previous projects (API level 11), but the default color of the activity title color is black. I…
5
votes
1 answer

How to prevent object to send null fields on API call for Retrofit2

I am facing issue with retrofit object fields. e.g: I have object name criteria and it has 20 fields no I want to send only first 4 fields on API call and rest all should be ignore while api call. Below is my object: public class Criteria…
5
votes
0 answers

setAlpha not working on ViewGroup instance

setAlpha has no effect on ViewGroup instances in API levels 14(ICS)-19(KitKat) even though it was introduced in API level 11. Any ideas why? I've even tried using the support library but that doesn't work either. Example: LayoutInflater…
olfek
  • 3,210
  • 4
  • 33
  • 49
4
votes
3 answers

.NET MAUI: How to ensure that Android platform specific code is only executed on supported Android versions?

I have various implementations of a partial class DeviceServices to provide platform specific implementations of certain device or OS specific features for Android, iOS and so on. My app is targeting API level 33.0 and the minimum version is API…
Julian
  • 5,290
  • 1
  • 17
  • 40
4
votes
2 answers

How to check Android 12 API level?

I am trying to check the android 12 API level using the below code. if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { // Do something for Android 12 and above versions } else { // Do something for phones running an SDK before Android…
4
votes
1 answer

An alternative to DateTimeFormatter in Android API-21

My app is crashing when I run it. It worked the first time I built and compile it but now it doesn't. I think this is due to the "DateTimeFormatter" not being able to be used in my current api level 21. Is there a workaround this? Here is the…
4
votes
1 answer

Android 11 (API level 30) onTaskRemoved fired in Foreground service when app go to background

I tried to test app that I work with on android 11 (got it on Pixel 3 XL). I receive strange behaviour when app goes to background: onTaskRemoved fired on Foreground service and looks like app killed and restarted. Info about Foreground service: in…
4
votes
1 answer

Foreground service in API Level 24 - Android 7.0 Nougat

My question is specific to API LEVEL 24 - Android 7.0 Nougat. I am trying to find the most appropriate and futureproof way to start a sticky foreground service. To sum up: - The service needs to be started from an activity after a button press - A…
AlexandrosD
  • 505
  • 4
  • 13
4
votes
0 answers

PersistableBundle setBoolean showing Min API Wrong

In Android Studio, while using PersistableBundle for jobSchedular, In functions 'setBoolean', 'getBoolean', it is showing that minimum API required is API 22 but in Google Android Docs it shows that Min API is API 21. Can Anyone one tell me if i am…
4
votes
1 answer

How should I do lowering the minimum SDK version?

I'm working on an Anrdoid app. It's almost finished. I've just noticed that the minSdkVersion is set to 21. Maybe I forgot it when I created the project. I'd like to lower it, because the app's users will likely to have older devices. I don't think…
klenium
  • 2,468
  • 2
  • 24
  • 47
4
votes
1 answer

If I make an app at API level 21 (5.0), will it work with newer version of android?

I just started to use android 2 weeks ago. I have successfully made my first app with API level 21 (5.1 Lollipop). My phone's android is also 5.1 Lollipop. I wonder if my app will work with all newer version of android, such as 6.0 marshmallow or…
4
votes
1 answer

shouldInterceptRequest called twice for deprecated and non deprecated variant when using non deprecated

I have webView which overrides shouldInterceptRequest method: @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @Override public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) { WebResourceResponse response =…
Jehy
  • 4,729
  • 1
  • 38
  • 55
4
votes
1 answer

AndroidManifest attributes depending on API level

Using startActivityForResult doesn't work properly in Android < 5.0 when using launchMode singleInstance or singleTask. However, I'm using that launchMode to avoid WebView…
RominaV
  • 3,335
  • 1
  • 29
  • 59
4
votes
2 answers

Error inflating class android.support.design.widget.FloatingActionButton in Android

When I'm trying to build the application it will show the android.view.InflateException in FloatingActionButton? I really don't know what causes the error. Login.xml
4
votes
2 answers

Can't update app in store because of target api23 (no downgrade possible)

long story short: I have an app in the store, uploaded with target(!) api23 Now I have to use the metaio SDK (Augmented reality) to implement a feature this SDK is not maintained anymore (company got bought & closed by apple) metaio SDK crashes…
Thkru
  • 4,218
  • 2
  • 18
  • 37