The 2022 Android Developer Roadmap — Part1
The Android ecosystem is in a constant state of growth: Every day, new libraries and materials are introduced that are designed to accelerate development speed and make our lives as developers easier.
In this multipart series, you’ll learn all about the Android development ecosystem following our 2022 Android Developer Roadmap, giving you a more holistic view of the Android community and how you can progress as a developer.
The 2022 Android Developer Roadmap is designed to give you a comprehensive understanding of the current Android ecosystem and provides suggested learning paths along the way to help you grasp the concepts.
In part one of this 5-part series, we’ll start by covering the first four sections of the Android Roadmap:
- Android OS
- The Android Platform
- App Manifest
Before we start, don’t be intimidated by the list. You only need to look at the sections that seem helpful to you. Also, please note that this roadmap is opinionated, so if you have different opinions than those of the author, we’d love to hear them.
Let’s get started.
Android Programming Languages
All Android applications must be written using Kotlin, Java, and/or C/C++. Kotlin and Java are the primary languages developers use to build Android applications, while C++ is used to write performance-oriented or hardware-based features that use the Java Native Interface (JNI) to call native functions.
In this section, we’ll discuss Kotlin and Java.
When Google revealed the first version of their Android OS over a decade ago, they adopted Java as the main language for Android application development.
But why Java? As one of the oldest object-oriented languages, Java is easy to learn and it works well on the Dalvik Virtual Machine (DVM), which was inspired by Java Virtual Machine (JVM), making it portable for almost any device and operating system. So, when Google began building the Android system, Java was one of the most suitable languages.
Kotlin was born from JetBrains. It was initially designed for the JVM environment and combines functional and object-oriented programming. Since its release, Kotlin has become a rising star in Android development and other fields.
Here are a few reasons why Kotlin pairs so well with Android:
- Interoperability: Kotlin is 100% interoperable with Java and supports great interoperability with JVM environments.
- Safety: Android apps that contain Kotlin code are 20% less likely to crash according to the Android docs.
- Asynchronous: Kotlin’s use of coroutines allows it to provide asynchronous (non-blocking) programming support.
In addition to the points above, Google announced their Kotlin-first approach to Android development at Google I/O 2019. Since the announcement, the number of applications built with Kotlin has increased exponentially.
So if you were to start learning Android development now, Kotlin would be a great choice.
Android Operating Systems
The foundation of the Android platform is the Linux kernel, which allows Android to take advantage of certain security features. The Linux kernel has been used in millions of security-sensitive systems since its creation in 1991, so it has a long history of consistently being researched, tested, and improved upon by thousands of developers.
According to the Android docs, Android utilizes several key Linux security features including:
- A user-based permissions model
- Process isolation
- An extensible mechanism for secure inter-process communication (IPC)
- The ability to remove unnecessary and/or insecure parts of the kernel
Another key feature of Linux is its multiuser operating system, which allows multiple users to access independent system resources such as memory, CPU resources, RAM, and applications. By isolating user resources from one another, they can be protected from each other.
The Android platform takes advantage of the Linux multiuser system with its own Application Sandbox, which isolates app resources from each other and protects apps and the system from malicious apps. For more details, check out Application Sandbox.
Android Platform Architecture
Android platform architecture consists of six layers built on top of the Linux Kernel. (Note: The actual architecture is stacked in the reverse order of the figure above.)
Let’s discuss each layer:
The Linux Kernel
The Linux Kernel is the core of the Android platform architecture. It manages low-level memory and all the available hardware drivers — such as the WiFi driver, camera driver, audio driver, bluetooth driver, display driver, and all peripheral drivers — via its Low Memory Killer Daemon.
Hardware Abstraction Layout (HAL)
The hardware abstraction layout (HAL) bridges hardware capabilities to the higher-level Java API Framework by defining standard interfaces, allowing you to implement the low-level functionalities without modifying the higher-level systems.
HAL implementations are packaged into modules, which are stored as a shared library (
.so file) and loaded by the Android system at the appropriate time.
Android Runtime (ART) is an application Runtime System used by Android OS and one of the core features in the Android ecosystem. ART was invented to replace the Dalvik virtual machine for devices running Android version 5.0 (Lollipop) or higher.
The main role of ART is to execute the Dalvik Executable format (DEX) by translating DEX bytecode into machine code that your system can understand.
ART architecture was written to run multiple virtual machines on low-memory devices. Some key features are directly related to the speed of running the Android applications. Key features of ART include:
- Ahead-of-time (AOT) and just-in-time (JIT) compilation
- Enhanced garbage collection (GC)
- Converting an app package’s DEX files to condensed machine code (on Android 9 (API level 28+))
- Better debugging support, including detailed diagnostics and crash reporting, the ability to set multiple watchpoints, and more
For more details, check out Android Runtime (ART) and Dalvik.
Native C/C++ Libraries
The Native APIs let you manage native activities and access physical device components such as cameras, sensors, graphics, and audio. They are also exposed to the higher-level layers, so you can control the components of the physical device on the Java API framework.
Java API Framework (Application Framework)
The Java API framework is a collection of Android libraries written in Java and Kotlin that provide the entire feature-set of the Android OS. Android APIs include an extensible View System, reusable components, and system managers which are used to build your Android applications by simplifying the reuse of interfaces.
One of the more powerful APIs in the Java API framework is Android Jetpack, which is pushed by Google. Jetpack accelerates development speed by reducing boilerplate code so that developers can focus on the code they care about.
Also, it provides solutions like Lifecycle, UI toolkit, Navigation, Security, Caching, Scheduler, Dependency Injection, and a lot more. You’ll cover this deeply in future posts.
System apps are pre-installed apps such as email, SNS messaging, calendars, internet browsing, contacts, and more, which are located in the system partition with your ROM. The configuration of the System Apps may vary depending on the mobile phone manufacturer. For more details, you can check out System Apps.
In this section, you covered the overall architecture of the Android platform. For more details, check out Android Platform Architecture.
Every Android project must have an AndroidManifest.xml file which describes essential information about the application such as the package name, entry points, components, permissions, and metadata.
Package Name and Application ID
Every Android project must have a package attribute, which represents your application’s universally unique application ID in the AndroidManifest.xml file. The manifest file must be located in your /src/main folder.
package attribute is the only guaranteed way to identify your application on the Android system (Physical device) and in Google Play. The Android build tools use the
package attribute for the following:
- Applying the package name as the namespace for your app resources.
- Resolving implicit class names that are declared in the manifest file. For example, with the above manifest, an activity declared as
<activity android:name=".MainActivity">is resolved to be
io.getstream.chat.android.ui.MainActivity. So the classes also must be in the same package folder.
For more information, you can check out App Manifest Overview
This concludes part one of the 2022 Android Developer Roadmap. This section covered important details about Android’s architecture, so now you have a better grasp of how Android applications work under the hood.
Again, don’t be intimidated by the amount of information on this roadmap. Check out the sections that would be the most helpful to you to understand Android development.
Also, you don’t have to learn all there is to know about the Android operating system. However, understanding the overall Android platform architecture will definitely help you to build better Android applications.
And as always, happy coding!
Originally published at https://getstream.io.