Sunday, June 8, 2025

Android architecture

Android Inc was a start up and bought over by Google. Android uses a Linux kernel with the drivers for the phone hardware. The next higher layers are the HAL hardware abstract layer which expose the hardware to the upper layers. 

The next layer is the Android native library written in c it c++. WebKit, sqllit, media framework, c run time and OpenGL etc.  The Android runtime layer support the java app. 

Android translate the java byte code into dalvik byte code which is more optimised for low memory and processing. The dalvik byte code then run in a dalvik vm. The .class files are also consolidated and changed to  a single.dex. 

Earlier version of Android use JIT compiler in dalvik which translate segment of code which is used repeatedly (called traces) into machine code. Later version uses ahead of time AOT compilation which compile the whole byte codes to native code in ELF form during app installation. 

The next upper layer is the Java API framework which support the applications. 

No comments: