Building to Android…
seem like there are 3 variables to adjust…
Minimum API Level, which I can set in Unity build “Other” settings.
Target SDK Version, which I can set in the Manifest ( also Min API) like this…
But How do I set which installed version of Android SDK to use… you can only specify Android SDK path.
BUt within Android Studio, you can have one or many versions of Android installed, e.g Tools->Android->SDK Manager… I have Android 24,23 and 22 all installed. But I can’t find a way to select which one Unity is building against… is there a way ?
or maybe it doesn’t matter? does 24 contain everything that is in 23, plus a bit more for 24 ?
I don;t think that targetSdkVersion does this, as it works fine set to 23, if you only have SDK 24 installed.
hi jonPQ
Not clear on your exact issue with android versions
but will give a few pointers from what i know about it
(How do I set which installed version of Android SDK to use) = MINIMUM API LEVEL
you can set this in the UNITY EDITOR= build settings /player settings/other settings/identifications/minimum api level
MINIMUM API LEVEL that you set here will be the default android version unity will target (your app will only work for the version you set here and above. it will not work for any version lower)
setting your android version in unity is meant to work with that android version and above ( to be safe ideally you would want to test your app out on android versions that your users are likely to have )
example when i tried out unity every play i had to upgrade to a new tablet running android kitkat
because that was the minimum recruitment for UNITY EVERY PLAY to work at that time.
so to pick a specific android version all you have to do is set it as the MINIMUM API LEVEL in editor
if you want it to EXCLUSIVELY TARGET JUST 1 API version then you will need some custom coding to run on install/lunch of your application…
personally it looks like advanced coding and understanding logic will be needed i have not dealt with this scenario so i have no answers to how to target just 1 android API version exclusively
Thanks much for your help. I know how to set Minimum Api in unity or the manifest file.
I am curious to learn, how to change which version of the SDK (that is installed on PC/MAC) to use.
The is only one folder location for installign the Android SDK, but within it, you can download multiple old versions of the SDK libraries… there should be a way to choose which one you are building from.
THough I guess in most cases you’d always want to use the latest one.
It uses the android sdk version you picked inside unity
(you can download multiple old versions of the SDK libraries)
that’s how its always been with android sdks it is a LIBRARY to
pick which version/book you want.
You have to define which android build tools u need in your application
ie…UNITY / ECLIPSE / ANDROID STUDIOS (with unity you set that in your minimum api )
(there should be a way to choose which one you are building from.)
yes you can pick which version/book you want to use out of the android API library.
WHEN YOU DO - IT WILL USE THE VERSION U PICKED …(newer api versions should work but nothing older than what you picked)
so yes u can pick a (version/book) from android library to (read/build) your app
The way it works as default (what unity/android already does for you)
YOU PICK A VERSION - ANDROID USES THAT VERSION AND IT WILL TRY TO RUN ON NEWER VERSIONS IF IT CAN (anything thing out of this scenario will require some coding on your side)
Now is your question
pick only one android version and nothing else from the library??
what u might be suggesting to do
ANDROID USES ONLY ONE VERSION TO BUILD(this is already what happens when you pick your minimum api)
ANDROID SHOULD ONLY USE THIS VERSION AND NOTHING NEWER OR OLDER(you will have to write a custom code to achieve that. check links on my previous post)
overall i feel am still giving you the same answers if you better explain the issue you are having i might have a better answer for you
hope that clears things up a bit