Is it possible to achieve the same effect of any hardware independent functionality from the higher API levels in Android OS using the lowest or one of the lowest levels by default?
The compatibility library allows older API levels to have access to some newer platform functionality.
Related
If I were to choose minimum API 4.1, does it mean the features in 4.0 will not be available to me if I use 4.1 as my minimum API? Or with each new API you get all the older features as well as the new ones?
Of course you get all the older features. The minimum means that features newer than that will not be available on all devices, and that you need to check the version before attempting to use them (or risk a crash).
I am thinking to make an application but at the time I don't have API 21 and API 22 installed on my SDK due to some network problems and I'm unable to download any thing at the moment. I was wondering if I can make an app effective enough to target many devices without using API 21 and API 22.
Bilal, judging from your comments to others, I'm getting the impression that you don't fully understand how the API levels work in Android. Let me try and explain.
The minimum API level is pretty self-explanatory, as it refers to the minimum Android OS version that can run your app. You want to set this as low as possible to target the most devices. To determine which level you set depends entirely on your application. For example, if your app requires access to the Calendar APIs, your minimum API level would be 7, because that is when those APIs were introduced.
You almost always want to set your maximum API level to the highest possible. Google encourages this, because it allows you to take advantage of all of the new APIs that have been released. But what about the devices that are outdated? You can still enable backwards compatibility with those devices using the Support Library.
Finally, it is not necessary to download each and every API level in the SDK manager. You only need to download the most recent.
I want to implement a program that uses HCE, but my device has Android 4.3 and does not support HCE. Is it possible to deploy a HCE app to devices with API versions < 19?
No, that's not possible. The Android system before version 4.4 (API level less than 19) does not include the software stack that is necessary to perform HCE.
That's the point of having different API versions (levels). Each API level adds (and sometimes removes) functionality that is available to your apps. Specifically with API levels on ANdroid a higher level typically means more (with the exception of depreciation/removal) functionality. As HCE was introduced in API level 19, devices having a lower API level do not support that functionality.
Sometimes, however, there is functionality that is backported to lower API levels by means of Support Libraries. This is typically done to provide a consisted look and feel for apps across a broad range of platform verions and is mainly done for grahical user interface components. However, support for HCE requires modifications deep inside the Android system (NFC system service, NFC low-level library) that cannot be achieved by simply adding a support library to an app.
I am wondering what exactly API level means. I couldn't seem to find an answer by searching on Google.
Could anyone please explain what the term API level means?
This actually sums it up pretty nicely.
API Levels generally mean that as a programmer, you can communicate with the devices' built in functions and functionality. As the API level increases, functionality adds up (although some of it can get deprecated).
Choosing an API level for an application development should take at least two thing into account:
Current distribution - How many devices can actually support my application, if it was developed for API level 9, it cannot run on API level 8 and below, then "only" around 60% of devices can run it (true to the date this post was made).
Choosing a lower API level may support more devices but gain less functionality for your app. you may also work harder to achieve features you could've easily gained if you chose higher API level.
Android API levels can be divided to five main groups (not scientific, but what the heck):
Android 1.5 - 2.3 (Cupcake to Gingerbread) - (API levels 3-10) - Android made specifically for smartphones.
Android 3.0 - 3.2 (Honeycomb) (API levels 11-13) - Android made for tablets.
Android 4.0 - 4.4 (KitKat) - (API levels 14-19) - A big merge with tons of additional functionality, totally revamped Android version, for both phone and tablets.
Android 5.0 - 5.1 (Lollipop) - (API levels 21-22) - Material Design introduced.
Android 6.0 - 6.… (Marshmallow) - (API levels 23-…) - Runtime Permissions,Apache HTTP Client Removed
API level is basically the Android version. Instead of using the Android version name (eg 2.0, 2.3, 3.0, etc) an integer number is used. This number is increased with each version. Android 1.6 is API Level 4, Android 2.0 is API Level 5, Android 2.0.1 is API Level 6, and so on.
An API is ready-made source code library.
In Java for example APIs are a set of related classes and interfaces that come in packages. This picture illustrates the libraries included in the Java Standard Edition API. Packages are denoted by their color.
The API is the android platform that make up the core language that
you will use when developing, and as you get the API version higher
the SDK tools should also be updated (which are the tools for
developing and debugging).
You should also take into account the market and how many devices
will support my selected API and choose the lowest API target
possible for your app to adapt more devices.
My Android application uses minSdkVersion=3 and targetSdkVersion=8. I used 8 because that is the highest level of API the application was tested on; however, it was written for level 3 and does not use any features beyond that level (except one for level 4 using reflection). Could using targetSdkVersion=8 be causing:
the Android Market to filter the application for some devices? My intention is for the application to be available for ALL devices >= level 3 with NO filtering.
problems in the application since targetSdkVersion=8 will, according to google: "disable compatibility settings that are not required for the target version (which may otherwise be turned on in order to maintain forward-compatibility) or enable newer features that are not available to older applications".
No. targetSdkVersion:8 just tells the system that you support SDK 8 features, like installing to SD card. minSdkVersion is what will filter the app and hide it for users with a lower SDK.