Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Android SDK compiled/linked to APK or installed on Android device?

First some premises:

  1. Android applications make use of Android SDK API classes.

  2. A class definition is some code or parts of code, which gets compiled into machine code/bytecode.

  3. I assume that all (or most of) the classes/packages that make up Android SDK API are listed under:
    https://developer.android.com/reference/packages.html https://developer.android.com/reference/classes.html

    Which is a lot!


Now the question:

Where do these codes/data reside? Are they compiled along with the application code into the APK file or do they exist inside the Android OS on a device, in which case the application should dynamic-link to them?

If they're present on the device, then what difference does it make to compile the application with newer Android SDK versions (per compileSdkVersion in Android Studio for example)?

Let's say the "Android SDK Build-Tools" (which is not the same as "SDK Platform" (according to "SDK Manager" window!) and has its own versioning) takes care of compiling your code and therefore newer version mean better bytecode optimization and faster JAVA -> DEX translation!? build/compile tools

Does "SDK Platform" which you compile your android application against and set it's version with compileSdkVersion keyword, contain solely class declarations and reference-symbols?! Android SDK

What about Google APIs (e.g. Google Maps API)?

What about Android Support Library?

like image 758
chakmeshma Avatar asked Oct 03 '16 19:10

chakmeshma


1 Answers

The Android SDK code is baked into the device, and is not part of your apk.

Stuff you need to include via gradle compile gets into your apk (e.g. Support Library)

like image 63
marmor Avatar answered Oct 21 '22 01:10

marmor