MAD
MAD
Introduction
Android is an open-source operating system primarily used in mobile devices such as smartphones
and tablets. Developed by Google, it is based on the Linux kernel and supports a variety of
applications, most commonly Java and Kotlin. Android’s architecture is designed to be scalable,
from simple mobile applications to advanced enterprise solutions.
Android Architecture
• Linux Kernel: The foundation of the Android operating system. It handles low-level system
operations such as device drivers, memory management, and process management.
• Hardware Abstraction Layer (HAL): Provides standard interfaces that allow Android to
work with different hardware.
• Android Runtime (ART): Replaces Dalvik VM in recent versions. ART compiles code
ahead of time (AOT) for improved performance.
• Libraries: Android includes various native libraries for functions like graphics rendering,
database management, and web browsing (e.g., SQLite, OpenGL, WebKit).
• Application Framework: Provides high-level APIs for developers, including services like
window management, resource management, and noti cations.
• Applications: Apps are built on top of this framework and include system apps (like
contacts, calendar, and email) and third-party apps.
Android Versions
Android has undergone many iterations, and each version is named after a dessert or a sweet treat
(e.g., Cupcake, Donut, Ice Cream Sandwich). Android versions typically come with performance
improvements, new features, and changes to the underlying system.
• Key Versions:
◦ Android 1.x – Cupcake, Donut, Eclair
◦ Android 2.x – FroYo, Gingerbread
◦ Android 4.x – Ice Cream Sandwich, Jelly Bean
◦ Android 5.x – Lollipop
◦ Android 6.x – Marshmallow
◦ Android 7.x – Nougat
◦ Android 8.x – Oreo
◦ Android 9.x – Pie
◦ Android 10 – Q (First non-dessert-based name)
◦ Android 11, 12, 13, 14, etc.
Features
• Multi-tasking
• Rich UI and animations
• Noti cation system
• Bluetooth, NFC, Wi-Fi, and other connectivity options
• Content Providers for data sharing
• Built-in GPS support for location-based services
Open Handset Alliance (OHA)
fi
fi
The OHA is a consortium of companies that work together to develop open standards for Android
devices. Google, along with other hardware manufacturers, carriers, and software developers, is a
key member.
Dalvik was the original virtual machine that ran Android apps. It is now replaced by ART in recent
Android versions. Dalvik was a register-based VM that used Just-in-Time (JIT) compilation for
running apps.
The Android SDK is a set of tools for developing Android applications. It includes:
An AVD is an emulator con guration that allows you to simulate different types of Android devices
on your computer for testing purposes.
Development Environment
Android development can be done on Windows, macOS, or Linux. Android Studio is the most
commonly used IDE, which provides tools for coding, debugging, testing, and building apps.
The directory structure de nes where your app les will reside.
The AndroidManifest.xml le de nes essential information about the app, such as:
1. Context: Provides information about the application environment and facilitates interaction
with various system services.
Resources
Android supports different resource types for designing user interfaces and handling app data:
Localization
• Preparing for Localization: You can localize your app by creating resource les speci c to
each language (e.g., res/values-en/strings.xml for English, res/values-
fr/strings.xml for French).
• Strings: Always de ne user-visible strings in XML, so you can easily translate them into
different languages.
• Layouts: You may need to adjust layouts for different languages (e.g., right-to-left text
support for languages like Arabic).
Material Design
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
Material Design is a design language developed by Google. It uses grid-based layouts, responsive
animations, padding, and depth effects (like shadows and lighting) to create visually appealing and
easy-to-use UIs.
UI and UX
• UI (User Interface): Refers to the layout and interactive elements of an app (buttons,
menus, images).
• UX (User Experience): Encompasses the overall experience of using an app, including ease
of use, navigation, and how pleasant the app feels to the user.
Layouts
◦ Example:xml
<LinearLayout android:orientation="vertical">
◦ <Button android:text="Click me"/>
◦ <TextView android:text="Hello"/>
◦ </LinearLayout>
◦
• Absolute Layout: Positions elements at speci c (x, y) coordinates (not recommended as it’s
deprecated).
• Frame Layout: A simple layout used to display one child at a time. It is mainly used for
stacking views on top of each other.
• Relative Layout: Allows you to position children relative to each other (e.g., to the left of,
below, etc.).
• Constraint Layout: A exible layout that allows you to create complex layouts by de ning
constraints between child views.
UI Widgets
• Dialog Boxes: Provide an interactive window to display messages or prompt user actions
(e.g., AlertDialog).
• Menus: