You are on page 1of 8

St.

Francis Institute of Technology


SV Road, Borivali (West), Mumbai 400103

Department of Computer Engineering

Academic Year: 2023-2024 Semester: VIII


Subject: Distributed Computing Class / Division: BE/CMPN B
Name: Vedant Pednekar Roll Number: 36

Experiment No: 10
Aim: A case study on Android Stack.

Pre-requisites: Mobile Computing

THEORY:

Give the overview of the following points


i. Android

Android is an open-source mobile operating system developed by Google, known for its
versatility and widespread adoption across a variety of devices. It offers customizable user
interfaces, extensive app support through the Google Play Store, and seamless integration with
Google services. Android provides developers with robust tools and APIs for building innovative
applications, although fragmentation remains a challenge due to the diversity of device hardware
and software versions. Despite this, Android's flexibility, security measures, and constant updates
contribute to its dominance in the mobile industry, serving billions of users globally.
Initially developed by Android Inc., the platform was acquired by Google in 2005. The first
commercially available Android device, the HTC Dream (also known as the T-Mobile G1), hit
the market in 2008. Since then, Android has experienced exponential growth, becoming the most
widely used mobile operating system worldwide.
One of the defining characteristics of Android is its open-source nature, built on a Linux kernel.
This openness allows developers to modify the operating system to suit their needs, fostering
innovation and collaboration within the developer community.
Android provides users with extensive customization options, allowing them to change themes,
install third-party launchers, and personalize various aspects of the user interface. This flexibility
appeals to a wide range of users with diverse preferences.
The Google Play Store serves as the primary distribution platform for Android apps, offering
millions of applications across various categories such as productivity, entertainment,
communication, and gaming. Developers leverage the Play Store to reach a global audience and
monetize their apps.
Android seamlessly integrates with Google's ecosystem of services, including Gmail, Google
Drive, Google Maps, Google Assistant, and more. This integration enhances user experience by
providing easy access to Google's suite of tools and services.
Developers benefit from a robust set of tools and APIs provided by Android for building
innovative applications. Android Studio, the official IDE for Android development, along with a
comprehensive SDK and support for languages like Java and Kotlin, empowers developers to
create feature-rich apps.
Despite its strengths, Android faces challenges such as fragmentation, which refers to the
diversity of device hardware configurations and software versions across different manufacturers
and models. This can make it challenging for developers to ensure consistent performance and
compatibility across all Android devices.
To address security concerns, Google continuously improves Android's security with features
like Google Play Protect, app sandboxing, encryption, and regular security updates.
Overall, Android's flexibility, extensive app ecosystem, integration with Google services, and
ongoing development efforts have solidified its dominance in the mobile industry, serving
billions of users globally across smartphones, tablets, smartwatches, TVs, and other IoT devices.

ii. Android Stack

The Android stack comprises four main layers: the Linux kernel, providing core system
functionalities such as memory management and device drivers; the Android Runtime (ART),
executing and managing application code through ahead-of-time (AOT) and just-in-time (JIT)
compilation; the Framework layer, offering a set of APIs for developers to access system services
like graphics rendering, UI design, and data storage; and the Application layer, where
user-installed applications reside, interacting with lower layers through the framework APIs. This
layered architecture enables Android to support a wide range of hardware configurations while
maintaining consistency and compatibility across devices. Additionally, Google Play Services
provides additional APIs and services for developers, facilitating integration with Google's
ecosystem. Overall, the Android stack's modular design fosters flexibility, scalability, and
innovation in mobile app development.
iii. Application Framework

The Application Framework in Android provides essential building blocks for creating various
types of applications. It includes components such as Activities, Services, Broadcast Receivers,
and Content Providers, which facilitate different functionalities within an app. Activities
represent individual screens with a user interface, while Services handle background tasks
independently of the UI. Broadcast Receivers listen for system-wide intents or messages,
enabling communication between different parts of the system or applications. Content Providers
manage access to a structured set of data, enabling data sharing between apps securely.
Additionally, the Application Framework offers features like resource management, notifications,
and user interface controls through Views and Layouts. Developers leverage these components
and features to build rich, interactive, and scalable applications for the Android platform.
● The UI Toolkit: Android provides a powerful UI toolkit that includes a wide range of UI
components such as layouts, views, widgets, and containers. Developers can use these
components to design visually appealing and interactive user interfaces that adapt to
different screen sizes and orientations. Android supports both XML-based layout files and
programmatically created layouts, providing flexibility in UI design.
● Activity Manager: The Activity Manager is responsible for managing the lifecycle of
application activities, which represent individual screens or user interactions within an
app. It handles activities' state transitions, ensuring that applications respond
appropriately to user interactions and system events.
● Content Providers: Content Providers facilitate data sharing and inter-process
communication between Android applications. They offer a standardized interface for
accessing and manipulating structured data, enabling secure and efficient data exchange
while enforcing data access permissions defined by the application developer.
● Resource Manager: The Resource Manager allows developers to organize and manage
application resources such as images, strings, layouts, and dimensions. Resources are
stored in resource directories within the app's project structure and are accessible through
resource identifiers (IDs), simplifying localization, theming, and resource management.
● Notification Manager: The Notification Manager enables developers to display
notifications to users, providing timely updates and alerts from applications. Notifications
can include text, icons, actions, and other interactive elements, enhancing user
engagement and communication.
● Intent System: The Intent system facilitates inter-component communication within and
between Android applications. Intents are asynchronous messages that enable
components such as activities, services, and broadcast receivers to request actions or
trigger events, promoting loose coupling and modularity in Android applications.
● Service Manager: The Service Manager oversees the lifecycle and execution of
background services within Android applications. Services are long-running operations
that perform tasks such as network requests, data processing, and content syncing in the
background, independent of user interaction.
● Input Method Framework: The Input Method Framework provides support for handling
user input methods such as keyboard, voice input, and gestures. It includes APIs for
implementing custom input methods, managing input focus, and detecting user
interactions, enabling developers to create flexible and accessible input experiences
tailored to diverse user preferences and device capabilities.

iv. Application runtime

The application runtime in Android encompasses the environment where Android apps are
executed. It includes the Dalvik or ART (Android Runtime) virtual machines, which are
responsible for converting app code into machine language. Android's runtime also manages
memory allocation, garbage collection, and resource management, ensuring efficient app
performance.
Developers write apps using languages such as Java, Kotlin, or other supported languages,
leveraging Android SDK tools and APIs. These tools and APIs provide developers with the
necessary resources to create feature-rich and innovative applications for the Android platform.
The runtime environment plays a crucial role in facilitating the seamless execution of apps across
a wide range of Android devices, contributing to the platform's versatility and popularity. It
supports various app architectures, including single or multi-threaded processes, which enhances
app responsiveness and scalability.
Similar to the Java Virtual Machine (JVM), the Dalvik Virtual Machine (DVM) is a
register-based virtual machine specifically designed and optimized for Android to efficiently run
multiple instances on devices. It relies on the Linux kernel for threading and low-level memory
management.
The core libraries provided by the Android runtime enable developers to implement Android
applications using standard Java or Kotlin programming languages. These libraries offer a wide
range of functionalities and services, allowing developers to create diverse and sophisticated
applications for Android users worldwide.

v. Platform libraries
Platform libraries in Android refer to collections of pre-built code modules provided by the
Android framework, facilitating common tasks such as UI design, networking, data storage, and
multimedia handling. These libraries include Android Jetpack, which offers a set of components
to simplify app development, and Google Play Services, providing access to various Google APIs
for services like maps, location, and authentication. Additionally, the Android Support Libraries
offer backward compatibility for older Android versions, while the Android Native Development
Kit (NDK) enables developers to incorporate native code written in languages like C and C++.
Platform libraries streamline development processes, enhance app performance, and ensure
consistency across Android devices, contributing to the overall efficiency of app development.

● Android Jetpack: Android Jetpack is a suite of components, tools, and guidance provided
by Google to accelerate Android app development. Jetpack components are categorized
into four main areas: architecture, UI, behavior, and foundation.
● Google Play Services: Google Play Services is a set of APIs and services offered by
Google to enhance the functionality of Android apps. It provides access to various
Google services, including maps, location, authentication, cloud messaging, and in-app
purchasing. Google Play Services enables developers to integrate powerful features into
their apps while leveraging Google's infrastructure and ecosystem.
● Android Support Libraries: Android Support Libraries offer backward compatibility for
older Android versions, allowing developers to use modern APIs and features on older
devices. These libraries include support for material design components, app
compatibility, RecyclerView, ViewPager, and other UI elements. By using support
libraries, developers can ensure that their apps are accessible to a wider range of Android
users without sacrificing functionality or user experience.
● Android Native Development Kit (NDK): The Android NDK enables developers to
incorporate native code written in languages like C and C++ into their Android
applications. It provides a set of tools and libraries for compiling and linking native code
with the Android platform. The NDK is typically used for performance-critical tasks such
as graphics rendering, audio processing, and game development, where native code
execution can offer significant performance improvements over Java or Kotlin.
● Platform libraries in Android streamline development processes, enhance app
performance, and ensure consistency across devices. By leveraging these libraries,
developers can focus on implementing app logic and user experiences without having to
reinvent the wheel for common tasks. Additionally, platform libraries help maintain
compatibility with evolving Android versions and device configurations, contributing to
the overall efficiency and effectiveness of app development on the Android platform.

vi. Linux Kernel

The Linux kernel serves as the bedrock of the Linux operating system, functioning as the nucleus
responsible for orchestrating hardware resources and furnishing indispensable system services.
Distinguished by its open-source nature, it bestows upon users the liberty to freely tinker with
and distribute its code as they see fit. Developed through the collaborative efforts of Linus
Torvalds and a global consortium of dedicated contributors, the Linux kernel boasts unparalleled
versatility, extending support to a diverse spectrum of hardware architectures and offering an
unparalleled level of customization. Within its architecture lie a myriad of features meticulously
crafted to bolster efficiency and reliability, including robust multitasking capabilities,
sophisticated virtual memory management, and an extensive suite of device drivers.
Linux, powered by its stalwart kernel, serves as the driving force behind an expansive array of
computing devices, spanning from the towering realms of servers and supercomputers to the
intricate ecosystems of embedded systems and smartphones. Its enduring stability, unparalleled
performance, and unrivaled scalability have firmly entrenched Linux as the preferred choice for a
myriad of applications, cementing its status as a titan in the realm of operating systems.

vii. Features of Linux kernel

The Linux kernel is the core component of the Linux operating system and serves as the
intermediary between software and hardware. Here's an overview of its features:

● Open Source: The Linux kernel is open-source software, meaning its source code is freely
available for modification and redistribution, fostering collaboration and innovation among
developers worldwide.
● Modularity: It follows a modular design, allowing features to be added or removed as needed,
making it highly customizable for different use cases and hardware configurations.
● Multitasking and Multiuser: Linux supports multitasking, enabling multiple processes to run
concurrently, and multi-user capabilities, allowing multiple users to interact with the system
simultaneously with appropriate access controls.
● Memory Management: The kernel manages system memory efficiently, allocating resources
to processes as needed and ensuring proper memory protection to prevent unauthorized
access or corruption.
● Device Drivers: Linux provides a robust framework for device drivers, facilitating
compatibility with a wide range of hardware devices, including processors, storage devices,
network interfaces, and peripherals.
viii. Android Compatibility

Android compatibility encompasses the seamless functioning of applications and features across
a diverse range of devices and Android operating system versions. Governed by Google's
stringent standards outlined in the "Android Compatibility Definition Document" (CDD),
compatibility ensures uniform behavior across devices, thus enhancing the user experience.
Developers diligently adhere to these standards, ensuring their apps adapt flawlessly to varying
screen sizes, resolutions, and hardware configurations prevalent in the Android ecosystem. To
further bolster compatibility, Google Play Services furnishes developers with APIs that grant
access to Google's features across different Android versions.
Despite concerted efforts to streamline compatibility, fragmentation persists as a formidable
challenge, attributable to the expansive and heterogeneous landscape of Android devices. To
surmount this obstacle, developers undertake rigorous testing regimes to ascertain compatibility
across a multitude of devices and configurations. Despite these challenges, Google's unwavering
commitment to enhancing compatibility continues to foster a more consistent and cohesive user
experience across the vast expanse of the Android platform.

ix. Dalvik Virtual Machine

The Dalvik Virtual Machine (DVM) served as the primary runtime environment for Android
until the advent of the Android 5.0 Lollipop, at which point it was supplanted by the Android
Runtime (ART). Specifically tailored for mobile devices, DVM operated by translating Java
bytecode into Dalvik bytecode, which was subsequently executed. Leveraging techniques like
just-in-time (JIT) compilation, DVM aimed to optimize performance, thus enabling Android
applications to operate efficiently even on resource-constrained devices.
A hallmark of DVM's design was its ability to dynamically load and unload bytecode as
necessitated by the application's execution, thereby conserving system resources. Despite its
efficiency in resource management, DVM was not without criticism, particularly regarding its
comparatively slower execution speed when juxtaposed with traditional Java Virtual Machines
(JVMs).
x. Binder IPC

Binder stands as a cornerstone of the Android operating system, serving as a high-performance


inter-process communication (IPC) mechanism that facilitates seamless communication between
diverse components within an Android application or between distinct applications running
concurrently on the system. This robust IPC framework plays a pivotal role in enabling the
efficient exchange of complex data structures across processes, thereby underpinning critical
system-level functionalities such as intent handling, service management, and interaction with
system services.
Implemented as a kernel driver, Binder harnesses the kernel-level capabilities to enforce stringent
security measures, including permissions and access controls, safeguarding the integrity and
confidentiality of inter-process communications. By adhering to these security protocols, Binder
ensures that communication between processes transpires securely, mitigating potential
vulnerabilities and fortifying the Android ecosystem against malicious exploits.
The integration of Binder within Android's architecture is instrumental in augmenting the
platform's stability, responsiveness, and multitasking capabilities. By facilitating seamless
communication between disparate components and applications, Binder contributes to the
cohesive and harmonious operation of the Android ecosystem, fostering a user experience
characterized by fluidity, reliability, and efficiency. In essence, Binder epitomizes the
technological prowess underpinning the Android platform, empowering developers to create
robust and feature-rich applications while safeguarding the integrity and security of inter-process
communications.

Conclusion:
Through our case study on the Android Stack, we gained valuable insights into its architecture
and functionalities. By dissecting its components and understanding their interactions, we
uncovered the robustness and flexibility of the Android platform. This study underscores the
importance of comprehending the underlying framework for developers and stakeholders,
facilitating informed decision-making and efficient application development in the dynamic
realm of mobile technology.

You might also like