Module 1:
Android Computing Platform
Android is an open-source, Linux-based operating system developed by
the Open Handset Alliance led by Google for mobile devices like
smartphones and tablets.
It provides a unified platform for application development, allowing apps
to run on various Android-powered devices. The first Android SDK beta
was released in 2007, and the first commercial version (Android 1.0)
launched in September 2008. The source code is available under free and
open-source licenses — most under the Apache License 2.0, and Linux
kernel changes under the GNU General Public License (GPL) v2.
Features
1. Beautiful User Interface
Mobile devices supported by the Android operating system provide a
beautiful and intuitive user interface, making it easier for users to operate
through devices. The default UI of Android relies on inputs, such as
pinching and swiping to initiate actions.
2. Connectivity
Android supports connectivity technologies, including GSM/EDGE, EV-DO,
IDEN, Wi-Fi, UMTS, Bluetooth, NFC, WiMAX, and more. This ensures
seamless communication and data transfer across various networks,
catering to diverse user needs and preferences.
3. Alternate Keyboards
Multiple keyboards are supported by Android. Although Skype, 8pen, and
Swift key apps enable changing the keyboard style, the operating system
doesn’t allow extra keyboards in other mobiles.
4. Media Support
Android supports a wide range of media formats. Some of these are
H.263, H.264, MIDI, MP3, AAC, AMR, AMR-WB, PNG, GIF, BMP, WAV, and
more. This ensures compatibility with a variety of multimedia content,
facilitating great accessibility and enhanced user experience.
5. Near Field Communication (NFC)
Short-range wireless connectivity, Near Field Communication (NFC), is
supported by a wide range of Android devices. It allows electronic devices
to communicate quickly and efficiently across short distances. The
primary purpose of NFC is to let users make payments quickly, eliminating
the need to carry cash or cards.
6. Storage
Android uses SQLite, a lightweight relational database for storage in
mobile devices. In addition, Android phones have SD card slots for
providing expandable storage.
7. Custom ROMs
Since the Android operating system is open-source, developers are
allowed to remove the current operating system and develop new
versions. Furthermore, users can download and install the new version of
Android OS as soon as they are available.
8. Infrared Transmission
Android OS also supports infrared transmitters that allow the smartphone
or tablet to be used as a remote control. This functionality enhances
convenience by consolidating control of multiple devices into a single,
portable device. Further, this has expanded the scope of Android-powered
devices in the domain of home automation and smart living.
9. Muti-touch, Multi-tasking, and Multi-language
Android supports multi-touch and multi-tasking, allowing users to jump
from one application to another while running simultaneously.
Furthermore, this operating system supports single and bi-directional
text.
10. Android Beam
The Android operating system is equipped with a popular NFC-based
technology that allows users to share quickly. All they need to do is touch
two NFC-enabled mobile phones together.
History
Founded by: Andy Rubin, Rich Miner, Nick Sears, and Chris
White
Company Name: Android Inc.
Founded in: October 2003 (in Palo Alto, California, USA)
Goal: To develop an advanced operating system for digital
cameras, but soon shifted to mobile phones after realizing the
market potential.
In July 2005, Google acquired Android Inc. for about $50
million.
In November 2007, Google formed the Open Handset
Alliance, a consortium of hardware, software, and telecom
companies.
Members included:
o Google, HTC, Samsung, LG, Motorola (mobile companies)
o Qualcomm, Intel, Nvidia (hardware companies)
o T-Mobile, Sprint, etc. (network providers)
The goal was to develop open standards for mobile devices.
The same day, Google announced Android as an open-
source OS.
Android Version
Version Code Name Releas Main Features / Highlights
e Year
1.0 – 2008 First Android release (HTC Dream / T-
(API 1) Mobile G1), Gmail, Maps, YouTube,
Market (Play Store), browser,
notifications, camera support.
1.1 – 2009 Bug fixes, Gmail attachment saving,
(API 2) Maps business details, longer screen
timeout, stability improvements.
1.5 Cupcake 2009 First dessert name, on-screen
(API 3) keyboard, widgets, auto-rotate, video
recording/upload, Bluetooth A2DP,
copy-paste improvements.
1.6 Donut 2009 Quick search box, multiple screen
(API 4) sizes, camera & gallery zoom, CDMA
support, voice/text search, battery
usage status.
2.0–2.1 Eclair 2009– Multiple Google accounts, Maps
(API 5– 2010 Navigation, live wallpapers,
7) enhanced camera, Bluetooth 2.1,
better UI and keyboard.
2.2 FroYo 2010 JIT compiler (faster performance), Wi-
(API 8) Fi hotspot, Flash support, push
notifications, move apps to SD,
improved Exchange email.
2.3 Gingerbrea 2010– New UI design, better battery, NFC
(API 9– d 2011 support, front camera, gaming
10) enhancements, improved copy-paste
and downloads.
3.0–3.2 Honeycomb 2011 Tablet-only version, holographic UI,
(API system bar/action bar, multitasking
11–13) view, USB support, multicore
processing.
4.0 Ice Cream 2011– Unified phone & tablet UI, Face
(API Sandwich 2012 Unlock, Holo design, data usage
14–15) tracking, better multitasking,
improved camera & browser.
4.1–4.3 Jelly Bean 2012– Project Butter (smooth UI), Google
(API 2013 Now, expandable notifications, voice
16–18) typing, multi-user (tablet), Daydream
screensavers.
4.4 KitKat 2013– Optimized for low RAM devices,
(API 2014 Immersive Mode, transparent bars,
19–20) smart dialer, printing support, better
memory management.
5.0–5.1 Lollipop 2014– Material Design UI, new notifications,
(API 2015 ART runtime, guest mode, Project
21–22) Volta (battery), 64-bit support,
SELinux security.
6.0 Marshmallo 2015 Runtime app permissions, Doze
(API w mode (battery saver), fingerprint
23) unlock, Google Now on Tap, USB
Type-C, adoptable storage.
7.0–7.1 Nougat 2016– Split-screen multitasking, quick
(API 2017 replies, improved Doze, Vulkan API,
24–25) seamless updates, Night Light mode,
app shortcuts.
8.0–8.1 Oreo 2017 Picture-in-Picture mode, notification
(API dots, autofill, faster boot, adaptive
26–27) icons, AI Neural Networks API,
background limits.
9.0 Pie 2018 Gesture navigation, Adaptive
(API Battery/Brightness, Digital Wellbeing,
28) App Actions, Slices, smarter
notifications.
10 (API Android 10 2019 System-wide dark mode, gesture
29) navigation, improved privacy, Focus
Mode, foldable support, better
sharing menu.
11 (API Android 11 2020 Chat bubbles, conversation section in
30) notifications, screen recording, one-
time permissions, improved media
controls.
12 (API Android 12 2021 Material You design, Privacy
31) Dashboard, camera/mic indicators,
dynamic theming, smoother
animations, improved privacy.
13 (API Android 13 2022 Per-app language, notification
33) permission, clipboard auto-clear,
spatial audio, Bluetooth LE Audio,
dynamic color expansion.
14 (API Upside 2024 Improved personalization, Health
34) Down Cake Connect, flash notifications,
background launch restrictions,
better privacy & accessibility.
15 (API (Upside 2025 Camera & media upgrades (HDR,
35) Down Cake low-light), SQLite performance boost,
- Extended) screen recording detection,
enhanced privacy & enterprise
features.
Android SDK
The Android SDK (Software Development Kit) is a complete set of
tools, libraries, and resources provided by Google to help developers
create, test, and debug Android applications. It acts as the
foundation for Android app development and works together with
Android Studio, the official Integrated Development Environment (IDE)
for Android.
Objectives of Android SDK:
1. To provide all the necessary tools for developing Android apps.
2. To allow developers to compile, build, and package Android
applications.
3. To help in testing and debugging apps using emulators or real
devices.
4. To ensure that apps are compatible with different Android versions
and devices.
5. To give access to Android APIs for hardware, sensors, media,
location, and network.
Features of Android SDK:
✅ Provides ready-to-use APIs for core Android functions.
🧩 Includes emulators for testing without a physical device.
🧠 Helps detect and fix errors using debugging tools.
⚡ Enables fast development with sample projects and templates.
🔄 Supports multiple Android versions for backward compatibility.
📦 Generates APK files for app distribution.
🔍 Allows performance profiling and optimization of applications.
Component Description / Functionality Example / Key
Name Tools
1. SDK Tools These are the core Tools like adb,
command-line tools emulator, monitor,
required to build and debug and sdkmanager.
Android apps. They are
platform-independent and
used by Android Studio for
basic development operations.
2. SDK These tools support adb (Android Debug
Platform Tools communication between Bridge), fastboot,
your computer and Android systrace.
devices (real or virtual). They
are updated with every
Android version to ensure
compatibility.
3. SDK Build Used to compile, build, and aapt (Android Asset
Tools package Android apps into Packaging Tool), aidl,
APK (Android Package) files. dx, zipalign.
These tools work with Gradle
during the build process.
4. Android A virtual Android device AVDs (Virtual
Emulator (AVD) that simulates a real Devices) for Android
Android phone or tablet on 10, 11, 12, etc.
your computer. It helps
developers test apps without a
physical device.
5. Android These are predefined Java [Link],
Platform / API and Kotlin libraries that [Link],
Libraries provide APIs to access Android [Link],
features like UI, media, [Link],
sensors, storage, location, etc. [Link].
6. Android A command-line tool that Commands like adb
Debug Bridge allows you to install, run, and install, adb logcat,
(ADB) debug apps directly on an adb devices.
emulator or real device. It acts
as a bridge between the
computer and the Android OS.
7. Android A tool for downloading and Used to update or
SDK Manager managing SDK install SDK tools and
components, system images, platforms.
and tools for different Android
versions.
8. Android A set of plugins and Android Studio’s
Developer extensions that help built-in code editor,
Tools (ADT) integrate SDK tools with debugger, and
Android Studio. They provide profiler.
GUI interfaces for easy
development.
9. Android Official guides, code Example projects like
Documentatio samples, and tutorials that “Hello World”,
n & Samples help developers understand tutorials for layouts
Android APIs and best and navigation.
practices.
10. Android A build automation system [Link] files in
Gradle Plugin that controls how apps are Android Studio
compiled, tested, and projects.
packaged using Gradle scripts.
Android packages
Android Java Packages are organized collections of pre-written Java
classes and interfaces provided by the Android framework. These
packages contain the essential tools, libraries, and functionalities required
to build Android applications. Each package focuses on a specific set of
tasks—such as creating user interfaces, handling data, managing app
components, connecting to the internet, accessing device hardware, or
playing media.
The main objective of Android Java packages is to simplify app
development by grouping related functionalities together, so developers
can easily use existing components instead of writing code from scratch.
They ensure code reusability, modularity, and easier maintenance
while providing a well-structured environment to create efficient, reliable,
and feature-rich Android applications.
Package Name Functionality Key Classes Features
[Link] Manages the Activity, Service, • Handles app
application Application, life cycle.•
and its Fragment, Creates screens
components Notification and services.•
such as Manages
Activities, notifications
Services, and and app-level
Notifications. behavior.
[Link] Manages data Intent, Context, • Enables app-
t sharing and ContentResolver, to-app
communicati SharedPreferences communication
on between , .• Transfers
components BroadcastReceiver data using
and apps. Intents.•
Accesses
stored or
shared data.
[Link] Provides the View, ViewGroup, • Manages how
basic Menu, UI elements
building SurfaceView appear and
blocks of the behave.•
user Handles screen
interface. layouts and
touch events.
[Link] Contains Button, TextView, • Provides
ready-made EditText, interactive
UI elements ImageView, components
(widgets) for ListView, Spinner, like buttons,
app CheckBox lists, and text
interfaces. boxes.•
Simplifies UI
design and
layout creation.
[Link] Allows apps to Bundle, Handler, • Handles
communicat Looper, Message, background
e with the Process threads.•
Android Passes data
operating between
system and Activities.•
manage Manages app
threads and processes.
messages.
[Link] Handles data SQLiteDatabase, • Provides SQL
se storage and Cursor, database
database ContentValues, access.• Stores
operations SQLException and retrieves
using SQLite. structured
data.•
Integrates with
Content
Providers.
[Link] Manages Uri, • Checks and
network ConnectivityMana manages
operations ger, NetworkInfo, network
like internet WifiManager, connections.•
and Wi-Fi HttpURLConnectio Handles data
connectivity. n transfer
through the
Internet.•
Supports TCP/IP
communication
.
[Link] Supports MediaPlayer, • Plays or
audio, video, MediaRecorder, records
and media AudioManager, audio/video.•
playback or ToneGenerator Manages
recording. volume and
playback
control.•
Supports
different media
formats.
[Link] Handles 2D Canvas, Paint, • Draws shapes
s drawing, Bitmap, Color, and images.•
images, Drawable Creates custom
colors, and UI designs.•
visual Manages image
effects. editing and
effects.
[Link] Provides LocationManager, • Retrieves
n access to Location, current GPS
device Geocoder, Criteria coordinates.•
location Converts
(GPS, Wi-Fi, addresses to
mobile coordinates.•
networks). Enables
location-based
services.
[Link] Provides Camera, • Uses device
re access to SensorManager, sensors
device SensorEvent, (camera,
hardware Sensor accelerometer,
features. proximity).•
Enables motion
and
environmental
data access.
[Link] Handles TelephonyManager • Accesses
ny phone and , SmsManager, phone info
network PhoneStateListene (IMEI, SIM).•
communicati r Sends SMS
on services. messages.•
Monitors call
and network
states.
[Link] Provides ObjectAnimator, • Adds motion
on classes for AnimatorSet, and visual
animations ValueAnimator, effects.•
and visual AnimatorInflater Supports
transitions. smooth
transitions.•
Improves user
experience.
[Link] Handles text TextWatcher, • Manages
formatting Spannable, editable text
and display Editable, fields.• Adds
operations. InputFilter color, style, and
formatting to
text.• Supports
auto-complete
and input
validation.
[Link] Provides tools WebView, • Displays web
to display WebSettings, content within
web pages WebChromeClient, the app.•
inside apps. WebViewClient Enables
browsing and
HTML
rendering.•
Supports
JavaScript
execution.
[Link] Used for PreferenceActivity, • Saves user
nce storing and PreferenceManage settings (like
managing r, dark mode).•
user PreferenceScreen Provides easy
preferences setup for
or settings. settings
screens.
[Link] Provides Log, SparseArray, • Supports
utility Xml, Base64 debugging
classes used (Log).• Handles
throughout data structures
Android and
applications. conversions.•
Encodes/decod
es data.
[Link] Used for Animator, • Controls
on property- ObjectAnimator, object
based AnimatorSet animation and
animation. visual effects.•
Improves user
interaction
feedback.
[Link] Manages Resources, • Accesses
[Link] resources AssetManager, external
such as Configuration resources.•
images, Adapts app
layouts, and design to
strings. device
configuration.
Fundamental Components
Application components are the essential building blocks of an Android
application These components are loosely coupled by the application
manifest file [Link] that describes each component of the
application and how they interact.
There are following four main components that can be used within an
Android application
Components & Description
1. Activities: They dictate the UI and handle the user interaction to the
smart phone screen.
2. Services: They handle background processing associated with an
application.
3. Broadcast Receivers: They handle communication between Android
OS and applications
4. Content Providers: They handle data and database management
issues.
Activities
An activity represents a single screen with user interface, in-short Activity
performs actions on the screen. For example, an email application might
have one activity that shows a list of new emails, another activity
composes an email, and another activity for reading emails. If an
application has more than one activity, then one of them should be
marked as the activity that is presented when the application is launched.
An activity is implemented as a subclass of Activity class as follows
publicclassMinActivityextendsActivity {
Services
A service is a component that runs in the background to perform long-
running operations. For example, a service might play music in the
background while the user is in a different application, or it might fetch
data over the network without blocking user interaction with an activity.
A service is implemented as a subclass of Service class as follows"
[Link]{
Broadcast Receivers
Broadcast Receivers simply respond to broadcast messages from other
applications or from the system. For example, applications can also-
initiate broadcasts to let other applications know that some data has been
downloaded to the device and is available for them to use, so this is
broadcast receiver who will intercept this communication and will initiate
appropriate action.
A broadcast receiver is implemented as a subclass of BroadcastReceiver
class and each message is broadcaster as an Intent object.
publicclassryReceiverextendsBroadcastReceiver{
publicvoid onRecive(context, intent) {}
Content Providers
A content provider component supplies data from one application to
others on request Such requests are handled by the methods of the
ContentResolver class. The data may be stored in the file system, the
database or somewhere else entirely.
A content provider is implemented as a subclass of ContentProvider,class
and must implement a standard set of APIs that enable other applications
to perform transactions.
publicclassMyContentProviderextendsContentProvider{
publicvoid onCreate(){}
Additional Components
There are additional components which will be used in the construction of
above-mentioned entities, their logic, and wiring between them. These
components are
Components & Description
1. Fragments: Represents a portion of user interface in an Activity.
2. Views: Ul elements that are drawn on screen including buttons, lists
forms etc.
3. Layouts: View hierarchies that control screen format and
appearance of the views.
4. Intents: Messages wiring components together.
5. Resources: External elements, such as strings, constants and
drawable pictures
6. Manifest: Configuration file for the application.
Android Virtual Devices
An Android Virtual Device (AVD) is a device configuration that is run with
the Android emulator. It works with the emulator to provide a virtual
device-specific environment in which to install and run Android apps. The
Android SDK includes a mobile device emulator, a virtual mobile device
that runs on your computer. In computing, an emulator is hardware or
software that enables one computer system (called the host) to behave
like another computer system (called the guest). An emulator typically
enables the host system to run software or use peripheral devices
designed for the guest system. The emulator lets you develop and test
Android applications without using a physical device. The creation and
management of virtual devices were discussed in IDE installation
To run an android application on a virtual device using Android Studio,
setup the AVD as follows.
1. Launch the Android Virtual Device Manager by selecting Tools >
Android> AVD Manager, or by clicking the AVD Manager icon in the
toolbar.
2. In the Your Virtual Devices screen, click Create Virtual Device.
3. In the Select Hardware screen, select a phone device, such as Nexus 6,
and then click Next.
4. In the System Image screen, choose the desired system image for the
AVD and click Next. If you don't have a particular system image installed,
you can get it by clicking the download link.
5. Verity the configuration settings (for your first AVD, leave all the
settings as they are), and then click Finish. Run the app from Android
Studio as follows:
1. In Android Studio, select your project and click Run from the toolbar.
2. In the Select Deployment Target window, select your emulator and click
OK
It can take a few minutes for the emulator to start. You may have to
unlock the screen. When you do, My First App appears on the emulator
screen.
Running on Real Devices
You can now run the app on a real device. To run android on real device,
set up your
device as follows:
1. Connect your device to your development machine with a USB cable. If
you're
developing on Windows, you might need to install the appropriate USB
driver
for your device.
2. Enable USB debugging on your device by going to Settings> Developer
options. (On Android 4.2 and newer, Developer options is hidden by
default.
To make it available, go to Settings > About phone and tap Build number
seven times. Return to the previous screen to find Developer options.)
Run the app from Android Studio as follows:
1. In Android Studio, select your project and click Run from the toolbar.
2. In the Select Deployment Target window, select your device, and click
OK
Android Studio installs the app on your connected device and starts it
Android Software Stack
Android operating system is a stack of software components, which is
roughly divided into five sections and four main layers as shown below in
the architecture diagram.
1. Linux kernel
2. Native libraries (middleware).
3. Android Runtime
4. Application Framework
5. Applications
1. Linux kernel
At the bottom of the layers is Linux. This provides a level of abstraction
between the device hardware and it contains all the essential hardware
drivers like camera, keypad, display etc. Also, the kernel handles all the
things that Linux is really good at such as networking and a vast array of
device drivers, which take the pain out of interfacing to peripheral
hardware. drivers, which take the pain out of interfacing to peripheral
hardware.
2. Libraries
A library is a collection of pre-written code, functions, or routines that can
be used by computer programs to perform common tasks, such as
input/output handling, data processing, or mathematical operations,
without having to write the code from scratch.
WebKit: Helps Android apps show web pages inside browsers or
apps (like when you open a website in Chrome or inside an app).
libc: A basic library that helps the system run faster and perform
common tasks efficiently.
SQLite: A small built-in database that stores app data — for
example, your contacts or messages.
Media libraries: Allow Android to play and record audio and
video files.
SSL libraries: Keep your internet data safe and encrypted
while you browse or use online apps.
2.1 Android Libraries
This category encompasses those Java-based libraries that are specific to
Android development. Examples of libraries in this category include the
application framework libraries in addition to those that facilitate user
interface building, graphics drawing and database access. A summary of
some key core Android libraries available to the Android developer is as
follows:
[Link] provides the classes and interfaces required to
build, manage, and control Android
applications.
[Link] help Android applications access and manage
application data, resources, and inter-app
communication.
It plays a key role in handling content sharing,
data storage, permissions, and application-level
communication.
[Link] provides classes and interfaces for managing
and accessing databases in Android
applications.
It allows apps to store, retrieve, update, and
manage structured data, usually using the
SQLite database engine built into Android.
[Link] provides a set of classes and interfaces that
allow Android applications to use OpenGL ES
(Open Graphics Library for Embedded Systems)
for rendering 2D and 3D graphics.
It enables developers to create high-quality
visual effects, games, and animations by
directly accessing the device’s graphics
hardware (GPU).
[Link] provides classes and interfaces that manage
the communication between different parts of
the Android system, including threads,
messages, processes, and system services.
It acts as a bridge between the Android
application framework and the underlying Linux
kernel, helping apps interact smoothly with the
system.
[Link] provides classes and interfaces for handling and
manipulating text in Android applications.
It supports displaying, formatting, styling, and
editing text content efficiently within user
interfaces.
[Link] provides classes and interfaces for creating and
managing the user interface (UI) of Android
applications.
It defines how elements like buttons, text
boxes, images, and touch interactions are
displayed and handled on the screen.
[Link] A rich collection of pre-built user interface
components such as buttons, labels, list views,
layout managers, radio buttons etc.
[Link] A set of classes intended to allow web-browsing
capabilities to be built into applications.
3. Android Runtime
This is the third section of the architecture and available on the second
layer from the bottom. This section provides a key component called
Dalvik Virtual Machine which is a kind of Java Virtual Machine specially
designed and optimized for Android. The Dalvik VM makes use of Linux
core features like memory management and multi- threading, which is
intrinsic in the Java language. The Dalvik VM enables every Android
application to run in its own process, with its own instance of the Dalvik
virtual machine. The Android runtime also provides a set of core libraries
which enable Android application developers to write Android applications
using standard Java programming language.
4. Application Framework
The Application Framework is like the toolkit for Android app
developers.
It contains pre-built tools and services that make it easier to build
apps — like showing notifications, managing screens, sharing data, and
designing layouts.
Instead of writing complex system code, developers can simply use
these ready-made features to create apps quickly and efficiently.
Activity Manager - Controls all aspects of the application lifecycle
and activity stack.
Content Providers - Allows applications to publish and share data
with other applications.
Resource Manager - Provides access to non-code embedded
resources such as strings, color settings and user interface layouts.
Notifications Manager - Allows applications to display alerts and
notifications to the user.
View System - An extensible set of views used to create application
user interfaces.
5. Applications
We will find all the Android application at the top layer; we will write our
application to be installed on this layer only. Examples of such applications
are Contacts Books, Browser, Games etc.
Android environment setup
Android code is written in Java and most of the core Android libraries are
built on Java. So, you need Java Development Environment and Android
SDK to build an Android Application. Windows, MAC OS and Linux
operating systems can be used for Android application development.
Installing the Android SDK and Prerequisites
Java Development Kit (JDK)
Android Studio
Android SDK (Software Development Kit)
Android Virtual Device (AVD)
Gradle
1. Java Development Kit (JDK)
The Java Development Kit (JDK) is an essential software package
required to write, compile, and run Java or Kotlin code for Android
development.
It includes the Java compiler, Java Runtime Environment (JRE), and
several development tools that help in building applications.
Android Studio uses the JDK to convert the source code written by
developers into a form that can be executed by the Android system.
Without JDK, Android apps cannot be compiled or run because it provides
the foundation for all Java-based programming.
2. Android Studio
Android Studio is the official Integrated Development Environment
(IDE) for Android app development, created by Google.
It provides a user-friendly interface for developers to write, edit, debug,
and test Android applications efficiently.
Android Studio includes all the necessary tools, such as a code editor,
emulator, debugger, and project management system.
It also supports Kotlin and Java languages, offers intelligent code
completion, and integrates seamlessly with Gradle for automated
builds.
3. Android SDK (Software Development Kit)
The Android Software Development Kit (SDK) is a collection of
libraries, tools, and APIs that developers use to create Android
applications.
It provides everything needed to interact with the Android operating
system, such as tools for building user interfaces, accessing device
features, managing data storage, and connecting to the internet.
The SDK is updated regularly to include the latest Android features,
ensuring that developers can build apps compatible with all Android
versions and devices.
4. Android Virtual Device (AVD)
An Android Virtual Device (AVD) is an emulator that allows
developers to simulate a real Android device on their computer.
It helps test and debug applications without needing an actual physical
phone or tablet.
Developers can configure different device types, screen sizes, Android
versions, and hardware settings in the AVD Manager.
By running the app on the emulator, developers can observe how it
behaves across various devices and screen configurations, ensuring better
compatibility and performance.
5. Gradle
Gradle is a powerful build automation tool integrated into Android
Studio.
It is responsible for compiling the source code, managing
dependencies, and packaging the final Android app (APK or AAB)
for testing or publishing.
Gradle automates repetitive tasks like code compilation, resource linking,
and version control, saving developers time.
It also ensures that the app is built consistently across different systems,
making it an essential part of the Android development workflow.
Set-up Java Development Kit (JDK)
[Link] JDK
o Visit the official Oracle JDK website or use OpenJDK.
o Choose the version suitable for your operating system
(Windows, macOS, or Linux).
o Click Download and save the installer file.
2. Install JDK
o Run the downloaded installer file.
o Follow the on-screen instructions and complete the
installation.
o Note the installation path (for example: C:\Program Files\
Java\jdk-17).
3. Set Environment Variable (JAVA_HOME)
o Open System Properties → Advanced System Settings →
Environment Variables.
o Click New under System Variables and add:
Variable Name: JAVA_HOME
Variable Value: path to your JDK folder (e.g., C:\
Program Files\Java\jdk-17).
o Edit the Path variable → click New → add: %JAVA_HOME%\bin
4. Verify Installation
o Open Command Prompt (Windows) or Terminal
(Mac/Linux).
o Type the following commands to check if JDK is correctly
installed:
o java -version
o javac -version
o If both commands display the Java version, your JDK setup is
successful
5. (Optional) Configure in Android Studio
o Open Android Studio → File → Settings → Build,
Execution, Deployment → Build Tools → Gradle.
o Ensure the JDK location is set to the correct installed path.
Android IDEs
There are so many Android IDEs are available to develop android
applications, the familiar technologies, which are most widely used are
follows
Android Studio
Eclipse IDE
You can choose any IDE to develop android applications according to your
comfort.
Android Studio
Android Studio is the official Integrated Development Environment
(IDE) for Android app development, created by Google and built on
JetBrains’ IntelliJ IDEA platform.
It provides all the necessary tools, editors, and features to design,
write, test, and debug Android applications efficiently.
Install Android Studio
On Windows:
1. Run the .exe installer.
2. Choose components like Android Studio, Android Virtual Device
(AVD).
3. Select installation path.
4. Complete setup and click Finish.
On macOS:
1. Open downloaded .dmg file.
2. Drag Android Studio to the Applications folder.
3. Open Android Studio from Launchpad.
On Linux:
1. Extract the .zip file.
2. Navigate to folder → run:
3. ./bin/[Link]
First-Time Configuration
When Android Studio opens for the first time:
1. Click Next → Standard Installation.
2. Select theme (Light/Dark).
3. Android Studio will download:
o Android SDK
o Android SDK Platform Tools
o Android Emulator
4. Click Finish.
Configure SDK and Tools
Check SDK Location
Go to: File → Settings → Appearance & Behaviour → System
Settings → Android SDK
Install SDK Platforms
Select versions like Android 13 / SDK 33 or Android 12 / SDK 32.
Install SDK Tools
Enable:
Android SDK Build-Tools
Android SDK Platform-Tools
Emulator
Intel HAXM / Android Emulator Hypervisor Driver
Set Up Android Virtual Device (AVD)
1. Open AVD Manager:
Tools → Device Manager
2. Click Create Virtual Device.
3. Select device (e.g., Pixel 6).
4. Choose system image (e.g., Android 13).
5. Finish → Click Play to launch emulator.
Create First Android App
1. Go to File → New → New Project
2. Select Empty Activity.
3. Enter:
o Name: MyFirstApp
o Package Name
o Language: Java / Kotlin
o Minimum SDK version
4. Click Finish.
Run the App
Use AVD Emulator (virtual device), OR
Connect a real phone:
o Enable Developer Options → USB Debugging.
o Connect via USB and select device in Android Studio.
Environment Variables (Optional Manual Setup)
For manual SDK usage from command line (Windows):
Variable Name: ANDROID_SDK_ROOT
Path: C:\Users\<YourName>\AppData\Local\Android\Sdk
Add SDK tools to PATH: %ANDROID_SDK_ROOT%\platform-tools
%ANDROID_SDK_ROOT%\tools
Update & Maintenance
Open SDK Manager regularly to update packages.
Keep Android Studio, SDK Tools, Emulator up to date for
stability.
Android Application Life Cycle
The phases that an application goes through from start to end is called
application life cycle, it is very important to have a basic understanding of
android application life- cycle to efficiently manage resources and ensure
effective response to the users.
An android application is a collection of activities and an activity correlate
to a screen.
Every android application runs inside its own instance of Dalvik Virtual
Machine (DVM) At any point in time several parallel DVM instances can be
active. Unlike in Windows or Unix process an Android application does not
completely controls its application life-cycle.
Android applications have limited control over their life-cycles. Every
application should be prepared for untimely termination. Android gives
priority to ensure smoother user experience by killing or terminating other
processes. Applications are terminated based on its priority and state of
the process. If two applications have the same priority, the process that
has been at that priority longest will be killed first. However, killed apps
may be restored to their last state when requested by the user. Android
devices are still considering as resource constrained while comparing
standards of modern computers and laptops. So, it is very important to
ensure that the limited resources are managed effectively to make our
applications to remain responsive all times. In an ideal case, all Android
applications started by the user remain in memory. That makes
applications switching much faster for the user. However, in reality the
available memory on an Android device is limited. To manage these
limited resources, the Android system can terminate running processes. If
the Android system needs to free up resources it follows a simple set of
rules, every process gets a priority in the following order. If the Android
system needs to terminate processes, it follows the following priority
system.
Process state Description priority
Foreground An application in which the user is 1
interacting with an activity, or which
has a service which is bound to such
an activity. Also, if a service is
executing one of its lifecycle
methods or a broadcast receiver
which runs its onReceive() method
Visible User is not interacting with the 2
activity, but the activity is still
(partially) visible or the application
has a service which is used by an
inactive but visible activity.
Service Application with a running service 3
which does not qualify for 1 or 2
Background Application with only stopped 4
activities and without a service or
executing receiver. Android keeps
them in a least recent used
(LRU) list and if requires terminates
the one which was least used
Empty 5
Application without any active
components.
All processes in the empty list are added to a least recently used list (LRU
list). The processes which are at the beginning of this list will be the ones
killed by the out-of- memory killer. If an application is restarted by the
user, it gets moved to the end of this queue. If it reaches the lowest
priority again. The application object is created before any of your Android
components are started. If you do not specify one in your
[Link] file, the Android system creates a default object for
you. It is started in a new process with a unique ID under a unique user.
This object provides the following main life-cycle methods:
onCreate () -called before the first components of the application
starts
onLowMemory() -called when the Android system requests that the
application cleans up memory
onTrimMemory() - called when the Android system requests that the
application cleans up memory. This message includes an indicator in
which position the application is.
onTerminate()-only for testing, not called in production
onConfigurationChanged()-called whenever the configuration
changes
The application object starts before any component and runs at least as
long as another component of the application runs.
Content provider life cycle
Once accessed a content provider is never stopped individually. It stops if
the whole application process is terminated.
Activity life cycle
An activity can be in different states depending how it is interacting with
the user. These
states are described by the following table.
State Description
Running Activity is visible and interacts with
the user.
Paused: Activity is still visible but partially
obscured, instance is running but
might be killed by the system
Stopped: Activity is not visible; instance is
running but might be killed by the
system
Killed: Activity has been terminated by
the system of by a call to its finish
() method
The Android system defines a life-cycle for activities via predefined life-
cycle methods. The most important methods are
Methods Description
onCreate() Called then the activity is created.
Used to initialize the activity, for
example create the user interface.
onResume() Called if the activity gets visible
again and the user starts
interacting with the activity again.
Used to initialize fields, register
listeners, bind to services, etc.
onPause() Called once another activity gets
into the foreground Always called
before the activity is not visible
anymore. Used to release
resources or save application data.
For example, you unregister
listeners, intent receivers, unbind
from services a remove system
service listener.
onStop () Called once the activity is no
longer visible. Time or CPU
intensive shut-down operations,
such as writing information to a
database should be down in the
onStop() method. This method is
guaranteed to be called as of API
11.
Android has more life cycle methods but not all of these methods are
guaranteed to be called. The Android system is allowed to recycle Android
activities to free up resources. In theory the Android system is allowed to
terminate individual activities but in reality the Android system never
recycles individual activities it always determines the whole process.
Structure of Android Application
A project in Android Studio contains everything that defines your
workspace for an app, from source code and assets, to test code and build
configurations. When you start a new project, Android Studio creates the
necessary structure for all your files and makes them visible in the Project
window on the left side of the IDE (click View> Tool Windows> Project).
Modules
A module is a collection of source files and build settings that allow you to
divide your project into discrete units of functionality. Your project can
have one or many modules and one module may use another module as a
dependency. Each module can be independently built, tested, and
debugged. Additional modules are often useful when creating code
libraries within your own project or when you want to create different sets
of code and resources for different device types, such as phones and
wearables, but keep all the files scoped within the same project and share
some code.
You can add a new module to your project by clicking File> New > New
Module
Android Studio offers a few distinct types of module:
Android app module: - Android App Module Provides a container for
your app's source code, resource files, and app level settings such as the
module-level build file "app". In the Create New Module window. Android
Studio offers the following app modules:
Phone & Tablet Module
Android Wear Module
Android TV Module
Glass Module
They each provide essential files and some code templates that are
appropriate for the corresponding app or device type
Library module: - Provides a container for your reusable code, which you
can use as a dependency in other app modules or import into other
projects. Structurally, a library module is the same as an app module, but
when built, it creates a code archive file instead of an APK, so it can't be
installed on a device. In the Create New Module window, Android Studio
offers the following library modules
Android Library: This type of library can contain all file types
supported in an
Android project, including source code, resources, and manifest files,
the build result is an Android Archive (AAR) file that you can add as
a dependency for your Android app modules.
Java Library: This type of library can contain only Java source files.
The build result is a Java Archive (JAR) file that you can add as a
dependency for your Android app modules or other Java projects.
Google Cloud module: - Provides a container for your Google Cloud
backend code.
This module adds the required code and dependencies for a Java App
Engine backend that uses simple HTTP, Cloud Endpoints, and Cloud
Messaging to connect to your app. You can develop your backend to
provide cloud services your app needs. Using Android Studio to create and
develop your Google Cloud module lets you manage app code and
backend code in the same project. You can also run and test your backend
code locally, and use Android Studio to deploy your Google Cloud module.
Project Files
By default, Android Studio displays your project files in the Android view.
This view does not reflect the actual file hierarchy on disk, but is
organized by modules and file types to simplify navigation between key
source files of your project, hiding certain files or directories that are not
commonly used. Some of the structural changes compared to the
structure on disk include the following:
Shows all the project's build-related configuration files in a top-level
Gradle Script group.
Shows all manifest files for each module in a module-level group
Shows all alternative resource files in a single group, instead of in
separate folders per resource qualifier. For example, all density
versions of your launcher icon are visible side-by-side.
Within each Android app module, files are shown in the following groups:
Manifests: - Contains the [Link] file.
Java: -Contains the Java source code files, separated by package names,
including JUnit test code
Res: - Contains all non-code resources, such as XML layouts, Ul strings,
and bitmap images, divided into corresponding sub-directories.
Project Structure Settings
To see the actual file structure of the project including all files hidden from
the Android view, select Project from the dropdown at the top of the
Project window.
When you select Project view, you can see a lot more files and directories.
The most important of which are the following:
build/-Contains build outputs.
libs/-Contains private libraries.
src/-Contains all code and resource files for the module in the
following subdirectories:
android Test/-Contains code for instrumentation tests that run on an
Android device
main/- Contains the "main" source set files: the Android code and
resources shared by all build variants.
[Link]-Deseribes the nature of the application and
each of its components.
java/- Contains Java code sources.
ini/- Contains native code using the Java Native Interface (JNI).
gen/- Contains the Java files generated by Android Studio, such as
your [Link] fije
and interfaces created from AIDL files.
res/- Contains application resources, such as drawable files, layout
files, and UI string.
assets/- Contains file that should be compiled into an .apk file as-is.
You can navigate this directory in the same way as a typical file
system using URIs and read files asa
stream of bytes using the AssetManager. For example, this is a good
location for textures and game data.
test/- Contains code for local tests that run on your host JVM.
[Link] (module) - This defines the module-specific build
configurations.
[Link] (project) - This defines your build configuration that
apply to all modules. This file is integral to the project, so you should
maintain them in revision control with all other source code.
Java Program 📱 Android Program (App-based)
(Console-based)
Package package [Link];
myfirstjavaapp;
import
public class HelloJava [Link];
{ import [Link];
public static void import [Link];
main(String[] args)
public class MainActivity extends
{ // Prints output to AppCompatActivity
console
{
[Link]("Hel
@Override
lo, Java!");
protected void onCreate(Bundle
}
savedInstanceState)
}
{
[Link](savedInstanceState);
// Sets the layout of the app screen<br>
setContentView([Link].activity_main);
// Find TextView from XML layout and set text
TextView tv = findViewById([Link]);
[Link]("Hello, Android!");
▶️Explanation: • Has ▶️Explanation: • Has multiple files (Java +
one file ([Link]) XML + Manifest) • Starts with onCreate()
• Starts with main() method in an Activity • Uses TextView to
method • Uses display text on phone screen.
[Link]() to
print message on
console.
🧾 Output: Hello, Java! 📱 Output: Text “Hello, Android!” appears on
(in console window) mobile screen.
📱 Android Program – Line-by-Line Explanation
package [Link];
✔ What it means:
This defines the package name of your app.
A package is like a folder that organizes your code.
It also gives your app a unique identity in the Play Store.
import [Link];
✔ What it means:
This imports the AppCompatActivity class.
AppCompatActivity is the base class for all screens (Activities) in
modern Android.
It gives your Activity features like:
o Action bar
o Theme support
o Compatibility with older Android versions
import [Link];
✔ What it means:
Imports the Bundle class.
A Bundle is used to store and transfer data between activities or
save the activity state.
import [Link];
✔ What it means:
Imports the TextView class.
TextView is a UI component that displays text on the screen.
We use it later to show "Hello, Android!".
public class MainActivity extends AppCompatActivity
✔ What it means:
Declares a new class called MainActivity.
This class represents one screen of your app.
extends AppCompatActivity means:
o MainActivity gets all features of AppCompatActivity.
o It becomes an Activity, which Android can display on screen.
@Override
✔ What it means:
This tells Android we are overriding a method from the parent
class.
We are providing our own version of the onCreate() method.
protected void onCreate(Bundle savedInstanceState)
✔ What it means:
This is the first method called when the Activity is created.
It is like the main() method in Java, but for Android screens.
It receives a Bundle to restore previous state (if any).
[Link](savedInstanceState);
✔ What it means:
Calls the parent class (AppCompatActivity) method.
Necessary for Android to properly create the Activity.
Sets up basic things like:
o window
o theme
o Activity lifecycle handling
setContentView([Link].activity_main);
✔ What it means:
Connects this Java class with the UI layout file.
[Link].activity_main refers to:
res/layout/activity_main.xml
This tells Android:
“Use the layout defined in activity_main.xml for this screen.”
TextView tv = findViewById([Link]);
✔ What it means:
Finds a UI element from the XML layout using its ID.
The ID textView comes from:
android:id="@+id/textView"
Stores it in a variable tv so we can change it in code.
[Link]("Hello, Android!");
✔ What it means:
Changes the text of the TextView.
Whatever was written in XML is replaced with "Hello, Android!".
In short:
This line displays “Hello, Android!” on the mobile screen.
✔ What it means:
These two curly braces close:
o The onCreate() method
o The MainActivity class
Folders, files and description
Java This contains [Link] source files
for your project. By default, it
includes an MainActivity java
source file having an activity class
that runs when your app is
launched using the app icon.
res/drawable-hdpi This is a directory for drawable
objects that are designed for high-
density screens.
res/layout This is a directory for files that
define your app's user interface
res/values This is a directory for other various
XML files that contain a collection
of resources, such as strings and
colours definitions.
[Link] This is the manifest file, which
describes the fundamental
characteristics of the app and
defines each of its components.
[Link] This is an auto generated file which
contains compileSdk Version,
buildToolsVersion, applicationld,
minSdkVersion, targetSdkVersion,
versionCode and versionName.
The Main Activity File
The main activity code is a Java file [Link]. This is the actual
application file which ultimately gets converted to a Dalvik executable and
runs your application. Following is the default code generated by the
application wizard for Hello World! Application.
package [Link];
import [Link];
import [Link];
publicclassMainActivityextendsAppCompatActivity{
@Override
protectedvoid onCreate(Bundle savedInstanceState){
[Link](savedInstanceState);
setContentView([Link].activity_min);
This program shows the output Hello world which is taken from already
programmed
java code. Here, [Link].activity_main refers to the activity_main.xml file
located in
the res/layout folder. The onCreate() method is one of many methods that
are figured
when an activity is loaded.
The Manifest File
Whatever component you develop as a part of your application, you must
declare all its components in a [Link] which resides at the root of
the application project directory. This file works as an interface between
Android OS and your application, so if you do not declare your component
in this file, then it will not be considered by the OS. For example, a default
manifest file will look like as following file.
<?xml version="1.0" encoding-"utf-8"?>
<manifestxmlns:android=[Link]
package-"[Link] >
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label-"@string/app_name*
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activityandroid:name= “. MainActivity")
<intent-filter>
<actionandroid:name="[Link]"/>
<categoryandroid:name="[Link]"/>
</intent-filter>
</activity>
</application>
</manifest)
Here <application> ...< /application> tags enclosed the components
related to the application. Attribute android: icon will point to the
application icon available under res/drawable-hdpi. The application uses
the image named ic_launcher.png located in the drawable folders
The <activity> tag is used to specify an activity and android:name
attribute specifies the fully qualified class name of the Activity subclass
and the android:label attributes specify a string to use as the label for the
activity. You can specify multiple activities using <activity>tags.
The action for the intent filter is named [Link] to
indicate that this activity serves as the entry point for the application. The
category for the intent- filter is named [Link]
to indicate that the application can be launched from the device's
launcher icon.
The @string refers to the [Link] file explained below. Hence,
@string/app_name refers to the app_name string defined in the
[Link] file, which is"Hello World". Similar way, other strings get
populated in the application
Following is the list of tags which you will use in your manifest file to
specify different Android application components
<activity>elements for activities
<service> elements for services
<receiver> elements for broadcast receivers
<provider> elements for content providers
The Strings File
The [Link] file is located in the res/values folder and it contains all
the text that your application uses.
<resources>
<stringname="app_name">Helloworld</string>
<stringname="hello_world">Hello world! </String
<stringname="menu_settings">Settings</string>
<stringname="title_activity_main">MainActivity</string>
</resources>
The Layout File
The activity main xml is a layout file available in res/layout directory, that
is referenced
by your application when building its interface. You will modify this file
very frequently
to change the layout of your application. You can drag and drop all the
required fields
to the layout from the palette window.
[Link] – Student Notes
Definition
[Link] is an auto-generated file created by Android Studio during
app development.
It contains unique IDs for all resources in the app (layouts, strings,
images, buttons, etc.).
Purpose
Acts as a bridge between XML files and Java/Kotlin code.
Allows the Java code to access resources using the R class.
Example:
[Link].activity_main → refers to activity_main.xml
[Link] → refers to a TextView in XML
Features
Automatically created by the Android build system.
Developers never edit [Link] manually.
Updated every time you add or modify a resource (XML, image,
string, etc.).
Stored in the generated folder (as [Link] in latest versions).
Contents of [Link]
It contains resource IDs grouped into inner classes like:
[Link] → layout files
[Link] → UI element IDs
[Link] → string resources
[Link] → images and icons
[Link] → color values
Important Points
[Link] is read-only.
Automatically updated when resources change.
Connects app resources to app code.
Essential for accessing any resource inside the app.