I'm just wondering if the latest Android SDK installed on the device contains the code of all previous versions?
So, if I targeted the API level 10 in my application and installed it on the device with Lollipop, will it just take and use the Gingerbread SDK in the same way as it was 3 years ago?
Or is there only one code base for all versions with a large number of checks and switches that are then triggered by some kind of compatibility mode that selects the correct code and how to enable the SDK version I?
I read an article about android: targetSdkVersion specified in the manifest , but still would like to know how this works inside.
Ok, I just worked a bit on the source code (which you can find here: https://github.com/android/platform_frameworks_base ). I'm not an Android infrastructure engineer, I was just curious to know about your question, and here is what I found.
It does not contain all versions of the source code. You can imagine that this will lead to a nightmare if more and more versions become available. First of all, you will have different (buggy) versions of the same method, without correcting them so that they are the same.
: (https://github.com/android/platform_frameworks_base/blob/59701b9ba5c453e327bc0e6873a9f6ff87a10391/core/java/com/android/internal/view/ActionBarPolicy.java#L55)
public boolean hasEmbeddedTabs() { final int targetSdk = mContext.getApplicationInfo().targetSdkVersion; if (targetSdk >= Build.VERSION_CODES.JELLY_BEAN) { return mContext.getResources().getBoolean(R.bool.action_bar_embed_tabs); } // ... return mContext.getResources().getBoolean(R.bool.action_bar_embed_tabs_pre_jb); }
, Android , . , ( ). ?
sdk Android . , android.jar( android.jar ) / .
, , android.jar() ( ) Gingerbread device.and, sdk 10 API, , , , .