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
2
votes
1 answer

Android - deprecated method and minApiLevel

Similar questions have been asked, but the provided answers did not really help me. Say I'm using a deprecated method and my minApiLevel is X. The suggested replacement of the deprecated method has api level Y. What should I do when Y > X (and I…
awa993
  • 177
  • 2
  • 14
2
votes
0 answers

Android API to read the network mode for Android Q and above

I am looking for an Android API, which would return the network mode for Q and above. We do have a way to get network mode by Reflection using getPreferredNetworkType from TelephonyManager class. But as per the android policy, we can't use…
2
votes
0 answers

createConfigurationContext is not working

I want to change my app language , this is a code I've for supporting different api versions val config: Configuration = context.getResources().getConfiguration() val locale = Locale(getDefaultLang()) val res: Resources =…
Navid Abutorab
  • 1,667
  • 7
  • 31
  • 58
2
votes
1 answer

Targetting API 28 update

i have several app with target SDK 26, and as everyone know since google applied new rules for play store SDK requirements, i have to update my target SDK to 28 which involves a lot of updates! I tried last days to do the update and i faced a lot…
ismail alaoui
  • 5,748
  • 2
  • 21
  • 38
2
votes
3 answers

Why I can still publish app that has Api level lower than 26 if google will only accept apps with Api level 26 or newer?

Recently I read a book about android which says that Starting with august 2019, Google play will only accept apps built using Api 26 or newer. But recently we published android app that has minimum Api level 23 and it is successfully published. Can…
Stack Overflow
  • 1
  • 5
  • 23
  • 51
2
votes
0 answers

Velocity Tracker returning different values for android 9.0

If I swipe from Right to Left in Samsung S5 or any device lower then 8.0 I get XVelocity in positive numbers and when I swipe right to left in devices greater then 8.0 like android 9 (Note9, s10) for the same swipe I get XVelocity in negative…
2
votes
1 answer

How can I can safely request showDropDown on FocusChange, on API less than 19?

I have an Android application crash, when the orientation is changed (rotated), because focus change tries to render a dropdown list on an AppCompatAutoCompleteTextView, that has already lost its parent window (I suppose). Caused by:…
2
votes
1 answer

Implement multiple methods for different API levels and not do if else to decide which one to call

I wonder if it's possible to implement multiple methods to support different API levels and call the right one without if(android.os.Build.VERSION.SDK_INT >= ...) else if...? I want to use android platform's newer features like streams etc. and…
ronginat
  • 1,910
  • 1
  • 12
  • 23
2
votes
1 answer

Determine target API

Is there a way for an Android app to determine its target API level? (Particularly in the case of a JAR library, which cannot influence which apps it is embedded in, while app developers may not be able to change the code of the JAR.)
user149408
  • 5,385
  • 4
  • 33
  • 69
2
votes
2 answers

How to run my Countdown Timer in Service in Latest API Level?

As we know latest API level in android version don't allow long background task in application. So, how can I run my 12 Hours countdown Timer in background because I have to do some task on Timer finish. So How can I achieve this.
2
votes
1 answer

How to set gravity for item for API level < 23

How can I set gravity for item inside layer-list for API level < 23?
Muhammadjon
  • 1,476
  • 2
  • 14
  • 35
2
votes
0 answers

Google Play Store reporting installs on old/deprecated SDK levels

A while ago (1 year), I have made the decision to drop support for Android 4.x devices for an app I am currently working on. I, of course, did that by setting the minSdk to a value greater than 19. I tested with an old 4.x device, opened the play…
saberrider
  • 585
  • 3
  • 16
2
votes
1 answer

Controlling "Usage & Diagnostics" in Android

Is there a way to control the automatic sending of diagnostics and usage data to Google in Android device. I could see the switch with "Usage & Diagnostics" in device settings, but need to control it via an application. Any API key exposed by…
2
votes
2 answers

Ranges in Kotlin below API 21

I want to store key-value pairs like < 4.1, 29..35 > which I can do with a HashMap>: val womanMap: HashMap> = hashMapOf() @RequiresApi(Build.VERSION_CODES.LOLLIPOP) fun createMap() { //This both requires…
TapanHP
  • 5,969
  • 6
  • 37
  • 66
2
votes
1 answer

Method View.getForeground() requires api 23

I'm trying to set the foreground on an AppCompatImageView in my app, but android studio is telling me that the getForeground() and setForeground methods require api 23. I thought this was a little odd given how simple it seems, so I checked the…
Jacob
  • 363
  • 4
  • 12