Unit-1(ii)
Unit-1(ii)
Unit-1(ii)
The Android architecture is a multi-layered system that combines various components to create
a seamless user experience. Let’s break it down:
1. Linux Kernel: Linux Kernel is heart of the android architecture. It manages all the available
drivers such as display drivers, camera drivers, Bluetooth drivers, audio drivers, memory drivers,
etc. which are required during the runtime. The Linux Kernel will provide an abstraction layer
between the device hardware and the other components of android architecture. It is
responsible for management of memory, power, devices etc. The features of Linux kernel are:
Security: The Linux kernel handles the security between the application and the
system.
Driver Model: It ensures that the application works properly on the device and
hardware manufacturers responsible for building their drivers into the Linux
build.
2. Hardware Abstraction Layer (HAL): Offers standard interfaces for device hardware (e.g.,
camera, Bluetooth) to the Java API framework. It provides standard interfaces that
expose device hardware capabilities to the higher-level Java API framework.
3. Android Runtime (ART): In android runtime, there are core libraries and DVM (Dalvik
Virtual Machine) which is responsible to run android application. DVM is like JVM but it
is optimized for mobile devices. It consumes less memory and provides fast
performance.les
4. 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:
5. Native C/C++ Libraries: Android includes a set of native libraries written in C/C++, which
provide essential functionality to the system and apps like for ART and DVM. These
libraries cover a wide range of functionalities, including graphics rendering (OpenGL),
media processing, SQLite database management, and more.
Android development tools refer to the software and frameworks used to build applications for
Android devices. Here is an overview of some key Android development tools:
• Android Studio: Android Studio is the official integrated development environment (IDE) for
Android app development. It provides a comprehensive set of tools and features to streamline
the development process. Some key features include:
o Code editor with intelligent code completion, code analysis, and refactoring
capabilities.
o Visual layout editor for designing app interfaces using drag-and-drop components.
o Debugger for identifying and fixing issues in the code.
o Profiler for analyzing app performance and memory usage.
o Emulator for testing apps on different virtual devices.
o Built-in support for version control systems like Git.
• Android SDK (Software Development Kit): The Android SDK is a set of tools and libraries that
developers use to create Android apps. It includes:
o Android API libraries for accessing various platform features, such as UI components,
sensors, network connectivity, and more.
o Command-line tools for tasks like building and deploying apps.
o Emulator for testing apps on virtual devices.
o Platform tools for debugging and managing devices.
• Gradle:
o The Android Emulator is a tool within Android Studio that allows developers to test
their apps on virtual Android devices.
o Developers can create and configure different virtual devices with varying
specifications, screen sizes, and Android versions for comprehensive testing.
o Set of profiling tools built into Android Studio to measure CPU, memory and network
usage of running apps. Helps optimize performance.
o The Android Profiler in Android Studio helps developers monitor app performance and
diagnose issues.
o It offers insights into CPU usage, memory allocation, network activity, and more,
allowing developers to optimize their apps for better efficiency.
• Firebase:
So in summary, Android Studio, Gradle, SDK, AVD and other tools form the core toolchain for
building, testing and debugging Android apps efficiently. These are just a few of the many tools
available for Android development. The combination of these tools and resources empowers
developers to create high-quality, efficient, and user-friendly Android applications.
When you create an Android application in Android Studio, it organizes your project into several
folders and files. Here’s a breakdown of the key components:
1. Manifests Folder:
o Contains the AndroidManifest.xml file, which defines essential information about
your app, such android version, package name, permissions, meta data,
activities, and more of the application and its components.
o Acts as an intermediary between your app and the Android OS.
2. Java Folder:
o Holds all the Java and Kotlin source code files (.java and .kt) for your app.
o Includes the main activity file (e.g., MainActivity.java or MainActivity.kt), where
you define your app’s behavior.
4. Gradle Scripts:
o These are build configuration files (e.g., build.gradle and settings.gradle) that
manage dependencies, build settings, and other project-related configurations
Every project in Android includes a Manifest XML file, which is AndroidManifest.xml, located in
the root directory of its project hierarchy. The manifest file is an important part of our app
because it defines the structure and metadata (which includes its icon, version number, themes,
etc.) of our application, its components, and its requirements like any required permissions, and
unit tests, and define hardware, screen, or platform requirements. It also specify whether our
app should install on an SD card of the internal memory
It serves as a blueprint, defining various aspects of the app’s behavior, requirements, and
interactions with the Android operating system and other applications. A typical manifest file
looks as:
<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="27" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MyApplication"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</manifest>
1. Components: For each app component (such as activities, services, broadcast receivers,
and content providers), you declare a corresponding XML element in the manifest. For
example:
2. Permissions: The manifest specifies the permissions your app needs to access protected
parts of the system or other apps. It also declares any permission required by other apps
to access content from your app.
3. Hardware and Software Features: You can define the hardware and software features
your app requires. This affects which devices can install your app from Google Play.
App components
<activity>: Represents an activity (UI screen) in your app. Each activity must be declared
here, specifying its name (Java/Kotlin class) and other properties.
<service>: Describes background services your app provides.
<receiver>: Declares broadcast receivers that listen `for system-wide events or custom
broadcasts.
<provider>: Defines content providers for data sharing between apps
For each app component that you create in your app, declare a corresponding XML element in
the manifest file. If you subclass any of these components without declaring it in the manifest
file, the system can't start it.