Target build and SDK - android

I am getting into Android app development now, what build should I choose as the target SDK and will my app work on higher APIs? Also, is there no API 20 build for KitKat, I only see one for KitKat Wear.

I believe you should set the API to what users have most, based on the latest numbers https://developer.android.com/about/dashboards/index.html?utm_source=ausdroid.net I believe you should set at least API 15 or better 16.

minimum required SDK = lowest version of the android that your app will support(make 10 if you want to target most of the devices, else make 14 or above if you don't want to use support library, good for beginning)
target SDK = you should choose it as latest stable version(choose 19 if you don't want support for android wear also)
compile sdk = 19
API 20 is specifically for applications designed for android wearables.
https://developer.android.com/training/wearables/apps/creating.html#SetupDevice

Related

Android minSdkVersion uses always minimum sdk even higher api devices

I use minimum sdk version 1.6 and run app on android device 4.0 but the app layout look likes devices with android 1.6. Is not it possible to use proper sdk based on device android version?
For clear my mean, suppose:
I use min sdk version 1.6 and target 8.0. I want when it runs on device version 4 it uses sdk 4, on device version 5 it uses sdk 5 and so on.
You can support different API levels creating multiple APKs taking advantage of this Google Play feature.
It’s essential to adopt some good practices from the get-go and prevent unnecessary headaches further into the development process.
Creating Multiple APKs for Different API Levels explains these steps in detail.

Can I only install the newest Android API to target lower API Version?

Say I wanna make an app with :
android:minSdkVersion="8"
android:targetSdkVersion="22"
My questions :
Do I need to install both "min SDK Version" as well as the target SDK version?
How if I only have SDK Version of 23 only? Can I make such setting? Or do I need to have both 22 as well as 8?
Can I debug such app with API / SDK Ver 21 phone?
Is it enough to only have the latest SDK version to develop any kind of app?
It is okay if there's any source (link) to comprehensive rule about such ruling, since I didn't found it even after extensive searching.
P.S. I don't know if this info is needed, but the app I wanna make is a libgdx game app.
Thanks
No. (the other answer is wrong)
You only need to have the version that you building with (compileSdkVersion in build.gradle). If you only have 23, then build with 23.
Usually, you should target the same version you build with. However, libgdx is not always fully tested with the latest Android. Check here under Android build version to see what it has been tested for. This is the SDK level you should should target if you want to be sure not to have any problems. Right now, it is version 20 of Android.
I have been targeting Android 22 without issue (that I know of), though. I haven't yet released something higher than 20 yet so no guarantees that it's perfectly safe.
Yes.
Yes. Generally, the target SDK version and the build SDK version should match, but it works if you target a lower version than you're building with.
Targeting a later API basically changes some default behavior of apps. Theoretically, you should be testing on devices spanning the full range of API levels that you support, but in practice this is unnecessary for a libgdx game. But if you target a version that's too old, you might miss out on some newer features. For example, if you target <19, immersive mode (which is desirable for most games) cannot be supported.
Yes you need to install
If you have SDK Version of 23 only but you want to build it in version 22 then also you need to install vesrsion 22 SDK.
Yes you can easily debug such app with API / SDK Ver 21 phone.
I think its enough.

What SDK to install, seriously?

I know there are plenty of documents over the internet but I have still some doubts about what SDK to install on my computer to create an android application for nearly %100 devices to working with. Google Play says that if I use API 8 (which is Android 2.2) then my application work nearly all Android devices.
So I downloaded API 8 and API 22 (Android 5.1, was default installed by Android Studio itself) and I don't know if it works or not if I select Minimum SDK to API 8 while creating a new project.
So seriously guys, what the heck is going on?
What SDK Platform(s) you install has little to no impact on what versions of Android you can support.
If you create a new Android Studio project via the new-project wizard, you will find an app/build.gradle file. In there, you will find a setting named compileSdkVersion. This controls what version of the Android SDK you are compiling against (i.e., what JAR is used to satisfy compile-time references to Java classes like Activity and TextView). Whatever value you specify for compileSdkVersion must be an "SDK Platform" that you have installed from the SDK Manager.
In a newly-created project given your setup description from your question, you will see that compileSdkVersion is 22, lining up with pre-established API Level 22 edition of the SDK Platform.
However, this does not mean that your app will only run on API Level 22+ devices. Much of what is in the API Level 22 edition of the Android SDK has existed in previous versions of the SDK.
The minSdkVersion property in the same app/build.gradle file says how old you are willing to go -- what is the lowest API level you are willing to support. Right now, I think a new project will be set up with minSdkVersion of 15, though that varies over time. More importantly, you can change it to be whatever you want, and you do not need the SDK Platform installed for whatever level you choose.
If, in your code, you reference stuff in the Android SDK that is valid for your compileSdkVersion but is newer than the minSdkVersion, the build tools will point out the discrepancy, so you can make sure that you know what you are doing. This is how Android handles progressive enhancement -- you see what version of Android you are running on (Build.VERSION.SDK_INT) and use newer APIs where you can, falling back to older APIs as needed.
TL;DR: So long as your compileSdkVersion has a value for which you have an installed SDK Platform, you're set.
It depends on the application you are developing. And the resources that it will need. It's true that if you use the oldest version (API 8) and your application is simple enough, then it will work on any device.
But there are limitations to it. on older APIs you will not be able to use new features as Navigation drawer for example
I would recommend API 11 or 14, that covers most of the devices and features nowadays.
You should consider the design you want to create on your app
You can see the market share of the different api versions here: https://developer.android.com/about/dashboards/index.html
Then you have a trade-off of how advanced APIs you want to use vs. how many devices you want to support.

What is minSdkVersion for Amazon Android in-app purchase SDK?

Some Amazon docs hint that it is 10, but examples run with 8. So what is the correct/safe/practical answer?
It is the minimum SDK requirement for application, App Developers put this variable to not install this app earlier version of device than min SDK version, it is just a safe check, to not install the app on incompatible devices
According to wikipedia http://en.wikipedia.org/wiki/Kindle_Fire the first Kindle Fire was based on Android 2.3.4 which is based on Android SDK version 10. Therefore there is no benefit to use minSdkVersion lower than 10.
If you use minSdkVersion lower than 10 your app will run on all Kindle Fires because new Android versions can run apps written for older Android versions.
However if you specify min SDK version 10 you can use all APIs that is available in the SDK version 10 but is not available in the Android SDK version 8.

Build Target and Min SDK version in Android

While creating an android project if i say that the Build Target of my Android porject is 2.2 (API Level is picked as 8) and in the text box for Min SDK version. If i put some value apart from the API level (smaller or greater than 8) of the build target then what happens?
Does the build happen according to the build target specified, but the application developed is compatible with the smaller android versions (if i specify API level < 8 ). Or the application developed is only compatible for the higher android version (if i specify API level > 8 ).
Can anyone please explain?
There is a similiar question already posted with an excellent answer:
Read the post by Steve H.
Android Min SDK Version vs. Target SDK Version
Say you set the manifest API level to 4, then the app will work on any api 4 device provided. BUT the project will be built to API level 8 so if you have any post-level 4 api methods in your code then the app will crash.
You can only put min SDK version less than your target version,it tell that your application can support to that min SDK version,but you should confirm that your application should run under min SDK version supported devices since the Build target versions may use new APIs which are available for that specific version and those APIs may not available in min SDK versions
ok.. if you have developed an application using particular sdk for instance Android 2.2 and your minSDKversion is < 8 then application is falsely declaring to android system that It can be installed in Android device having sdk version less than Android 2.2. In that case if application happens to install on Android 2.1 and if you re using API that are exculsiviely avaialbe in Android 2.2 platform and not on Android 2.1 then your application will crash on the device. if your minsdkversion > 8 then application won't get installed on the device having Android sdk 2.2 or lower version

Categories

Resources