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
677
votes
11 answers

Retrieving Android API version programmatically

Is there any way to get the API version that the phone is currently running?
Parth Mehta
  • 6,857
  • 2
  • 16
  • 5
494
votes
16 answers

Changing API level Android Studio

I want to change the minimum SDK version in Android Studio from API 12 to API 14. I have tried changing it in the manifest file, i.e., and rebuilding the project, but I…
James B
  • 8,975
  • 13
  • 45
  • 83
226
votes
4 answers

Get Android API level of phone currently running my application

Possible Duplicate: Programmatically obtain the Android API level of a device? How do I get the Api level of the phone curently running my application? I am sure its simple but I can not find it as all my searches bring up tons of junk.
Tegra Detra
  • 24,551
  • 17
  • 53
  • 78
188
votes
13 answers

Environment.getExternalStorageDirectory() deprecated in API level 29 java

Working on android Java, recently updated SDK to API level 29 now there is a warning shown which states that Environment.getExternalStorageDirectory() is deprecated in API level 29 My code is private void saveImage() { if…
Noaman Akram
  • 3,680
  • 4
  • 20
  • 37
103
votes
6 answers

Sources for Android API 23 Platform not found (Android Studio 2.0)

Android Studio doesn't redirect me to API sources correctly. When I hit any function it decompiles .class file bytecode instead of accessing the right file from sdk/sources tree. Hitting "download" and "refreshing" options does nothing. It's…
Luke
  • 2,539
  • 2
  • 23
  • 40
92
votes
2 answers

List of Android permissions normal permissions and dangerous permissions in API 23?

Which permissions need for requesting permissions at run time of API 23?
64
votes
9 answers

Pick up the Android version in the browser by Javascript

I'm building a web app and wanting to disable transitions effects on Android devices under version 3.0. Is there anyway to pick up the Android version number by Javascript in the browser? If so how?
Daniel Ryan
  • 6,976
  • 5
  • 45
  • 62
47
votes
6 answers

Choosing the right API Level for my android application

I currently have a application targeted at android 2.3 (api level 10), but went thinking that probably people using android 2.1/2.2 or older won't even be able to see the application in the market. So I thought that using api level 3 would be the…
user717572
  • 3,626
  • 7
  • 35
  • 60
29
votes
1 answer

'Call requires API level 23' error, but getForeground() exists on FrameLayout from API 1

Summary Finally, I found the related issue, setForeground() incorrectly flagged as requiring API 23 on ViewGroups extending FrameLayout. Issue 189041: setForeground() incorrectly flagged as requiring API 23 (NewApi) for ViewGroups extending…
27
votes
0 answers

Where can I complain about Google Store target API level restrictions

Google recently announced that they are going to start restricting publishing Android apps that do not target recent API level versions. I support this change, but I need some special case exceptions, and have not found an appropriate forum to…
kencorbin
  • 1,958
  • 1
  • 20
  • 18
26
votes
2 answers

Android development: api 14 vs api 15

I want to develop an app for android ice cream sandwich and versions above. So, what I discover is that android 4.0 supports api 14, and android 4.0.3 api 15. Look at the dashboard http://developer.android.com/about/dashboards/index.html . It seems…
user1315621
  • 3,044
  • 9
  • 42
  • 86
22
votes
6 answers

Apache HTTP Client Removal from API23, will that have an effect on Volley?

As we have known that Apache HTTP Client removed in API 23 Apache HTTP Client Removal However, Volley library currently still uses Apache's library such as import org.apache.http.Header; import org.apache.http.HttpEntity; import…
BNK
  • 23,994
  • 8
  • 77
  • 87
21
votes
1 answer

What is the android api for getting the list of connected audio devices?

I used the below added code to get the connected audio devices for android device. Used AudioManager api method getDevices() and got the result with connected devices like earphones, speaker, headphones. But this getDevices() method is available…
20
votes
4 answers

What is alternative to ConnectivityManager.TYPE_WIFI deprecated in Android P API 28?

ConnectivityManager.TYPE_WIFI is deprecated in Android P API 28. Also, NetworkInfo#getType and ConnectivityManager.TYPE_MOBILE's are also deprecated. So, what are the alternatives for them? I understood that the we've to use the method from…
Amrut
  • 2,655
  • 3
  • 24
  • 44
20
votes
6 answers

Android - Tinting ProgressBar on pre-Lollipop devices

My app's minimum API-level is 19 (KitKat), and contains a layout with a horizontal ProgressBar. I'm using android:progressTint attribute to tint the bar to a custom color. It works pretty well on Lollipop (API 21) and above, but below (for example…
1
2 3
21 22