Android - Overview
The 3 "Layers"
If you want to be an Android developer, these are the 3 "layers" you need to be aware of.
Android Framework (Base)
- packages under
- Open Source: https://android.googlesource.com/platform/frameworks/base.git
- Github Mirror: https://github.com/aosp-mirror/platform_frameworks_base
- the bare bone Android, with the most basic and core components.
- packages under
- Open Source: https://android.googlesource.com/platform/frameworks/support.git
- Github Mirror: https://github.com/aosp-mirror/platform_frameworks_support
- the naming can be confusing:
xdenotes "extensions", just like java vs javax; JetPack is the official fancy name for the project; the code is under name
supportsince JetPack's predecessor is named Support Library.
- has its own release schedule, more often than Android; provides backward compatibility
Google Play Services (GMS) And Firebase
- packages under
- Closed Source. Only Google certified companies can use it. When the news of "Google banning Huawei" came, it referred to this part, as Android(AOSP) is fully open sourced.
- for both Google's 1st party apps(e.g. YouTube, Google Maps) and 3rd party APIs.
- not available in China.
- Some devices may use AOSP but develop their own GMS equivalents(e.g. Amazon Fire)
- Originally Java is the main programming language
- Android was going Kotlin-first in 2019; Kotlin is strongly backed by Google and JetBrains (they co-created Kotlin Foundation), so it may be the future.
Since Android 8.0 Oreo.
Project Treble: adding interfaces to separate low-level (hardware specific) code from the main Android framework.
AOSP will compile to Android GSI (Generic System Images); devices certified with Project Treble should work with GSI images. Android framework can be replaced without rebuilding the Hardware abstraction layer (HAL).
Vendors or SOC makers build HALs once and place them in a
/vendorpartition on the device; the framework, in its own partition, can then be replaced with an over-the-air (OTA) update without recompiling the HALs.
Since Android 10
Project Mainline: update core OS components like apps (i.e. through Google Play Store).
- security and privacy patches can be delivered faster
- absorbing logics from OEMs where customizations are not needed
APEX vs APK:
- APEX is a new format, in addition to APK
- APEX are loaded much earlier in the booting process
- APK has more limited permissions
Moving away from Google Play Services?
Google Maps SDK for Android v3 is moving away from Google Play Services and becomes a standalone static library.
Similarly the new Places SDK is also a static library instead of relying on GMS; also it depends on AndroidX and moved away from support libraries.
Is this a trend?
Huawei phones would not get Google Apps and Play Store installed.
Other Notable Components
platform/frameworks/support, here lists some other interesting/important repos:
platform/libcore: Google's implementation of some core Java libs(e.g.
- bionic: the C library
UTC time on a device is NOT monotonic, it can jump forwards or backwards unpredictably. To calculate time deltas, always use
- Official Website: https://www.android.com/
- If you want to modify Android source, e.g. develop new devices:
- if you are developing Android apps:
- JetPack: https://developer.android.com/jetpack/
- Google Play Services: https://developers.google.com/android/
- if you are just curious about internals:
- Git Repositories: https://android.googlesource.com