Learn Android Architecture
Learn Android Architecture, android architecture components and programming and how to develop android mobile phone and tablet applications. Starting from environment setup, application components, activity lifecycle, service lifecycle, application architecture, publishing application, debugging applications, handling events, layouts etc.
Learn Android Architecture Components
What is Android?
- Android is an open source and Linux-based Operation System for Mobile Devices.
- It was developed by OPEN HANDSET ALLIANCE, lead by Google and other companies.
- It offers a unified approach to application development for mobile devices, developers only develop applications for Android and application runs on Android powered devices
- The first beta version of Android Software Development Kit (SDK) was released by Google in 2007 whereas first commercial version Android 1.0 was released in September 2008.
- The source code for Android is available under open and free software licenses. Google publishes most of the code under the Apache license version 2.0 and Linux Kernel Changes under GNU General public license version 2
What is System Apps?
You will find all the Android application at the top layer. You can write your application to be installed on this layer only.
Apps included with the platform have no special status among the apps the user chooses to install. So a third-party app can become the user’s default web browser, SMS messenger, or even the default keyboard (some exceptions apply, such as the system’s Settings app).
The system apps function both as apps for users and to provide key capabilities that developers can access from their own app. For example, if your app like to deliver an SMS message, you don’t need to build that functionality yourself—you can instead invoke whichever SMS app is already installed to deliver a message to the recipient you specify.
What is Java API Framework?
The entire feature-set of the Android OS is available to you through APIs written in the Java language. These APIs form the building blocks you need to create Android apps by simplifying the reuse of core, modular system components and services, which include the following:
- A rich and extensible view system you can use to build an app’s UI, including lists, grids, text boxes, buttons, and even an embeddable web browser
- A Resource Manager, providing access to non-code resources such as localised strings, graphics, and layout files.
- A Notification Manager that enables all apps to display custom alerts in the status bar.
- An Activity Manager that manages the lifecycle of apps and provides a common navigation back stack.
What is Native C/C++ Libraries?
Many core Android system components and services, such as ART and HAL, are built from native code that require native libraries written in C and C++.
The Android platform provides Java framework APIs to expose the functionality of some of these native libraries to apps. For example, you can access OpenGL ES through the Android framework’s Java OpenGL API to add support for drawing and manipulating 2D and 3D graphics in your app.
If you are developing an app that requires C or C++ code, you can use the Android NDK to access some of these native platform libraries directly from your native code.
What is Android Runtime (ART)?
For devices running Android version 5.0 (API level 21) or higher. Each app runs in its own process and with its own instance of the Android Runtime (ART). ART is written to run multiple virtual machines on low-memory devices by executing DEX files. A byte code format designed specially for Android that’s optimized for minimal memory footprint. Build toolchains, such as Jack, compile Java sources into DEX bytecode, which can run on the Android platform.
Some of the major features of ART include the following:
- Ahead-of-time (AOT) and just-in-time (JIT) compilation
- Optimized garbage collection (GC)
- Better debugging support, including a dedicated sampling profiler, detailed diagnostic exceptions and crash reporting.
- Prior to Android version 5.0 (API level 21), Dalvik was the Android runtime. If your app runs well on ART, then it should work on Dalvik as well. But the reverse may not be true.
- Android also includes a set of core runtime libraries. Library provides most of the functionality of the Java programming language, including Java API framework uses.
What is Hardware Abstraction Layer (HAL)?
The hardware abstraction layer (HAL) provides standard interfaces that expose device hardware capabilities to the higher-level Java API framework.
The Hardware Abstraction Layer (HAL) consists of multiple library modules. Each of which implements an interface for a specific type of hardware component such as camera, bluetooth etc. When a framework API makes a call to access device hardware, Android system loads the library module for that component.
What is Linux Kernel/Driver?
The foundation of the Android platform is the Linux kernel. The Android Runtime (ART) relies on the Linux kernel for underlying functionalities such as threading and low-level memory management.
Using a Linux kernel allows Android to take advantage of key security features. It allows device manufacturers to develop hardware drivers for a well-known kernel.
You can also learn android architecture using ebook listed below.
You can learn kotlin programming using this article.