Mobile Application Development
using Android
An Overview of Android App
Development
overview
Introduction to Android
• - Android is an open-source operating system
developed by Google.
• - It powers millions of mobile devices
worldwide.
• - Key Features:
• - Open-source
• - Extensive developer support
• - Versatile app development capabilities
Version Name API Level Release Date
1.0 No codename 1 September 23, 2008
1.1 No codename 2 February 9, 2009
1.5 Cupcake 3 April 27, 2009
1.6 Donut 4 September 15, 2009
2.0 – 2.1 Eclair 5–7 October 26, 2009
2.2 – 2.2.3 Froyo 8 May 20, 2010
2.3 – 2.3.7 Gingerbread 9 – 10 December 6, 2010
3.0 – 3.2.6 Honeycomb 11 – 13 February 22, 2011
4.0 – 4.0.4 Ice Cream Sandwich 14 – 15 October 18, 2011
4.1 – 4.3.1 Jelly Bean 16 – 18 July 9, 2012
4.4 – 4.4.4 KitKat 19 – 20 October 31, 2013
5.0 – 5.1.1 Lollipop 21 – 22 November 12, 2014
6.0 – 6.0.1 Marshmallow 23 October 5, 2015
7.0 – 7.1.2 Nougat 24 – 25 August 22, 2016
8.0 – 8.1 Oreo 26 – 27 August 21, 2017
9 Pie 28 August 6, 2018
10 Android 10 29 September 3, 2019
11 Android 11 30 September 8, 2020
12 Android 12 31 October 4, 2021
13 Android 13 33 August 15, 2022
14 Android 14 34 October 4, 2023
MARKET SHARE
• As of November 2024, Android has a
71.42% market share worldwide. In
the US, iPhones hold a market share
of 56.63%. More than 1 billion
iPhones and over 3 billion Android
devices are currently active. Android
smartphones accounted for 56% of
all smartphone sales worldwide in Q4
2023.
Android Architecture
• Android's architecture consists of:
• Linux Kernel: Manages core system services. Power
• Native Libraries: Includes libraries like WebKit, SQLite,
etc.
• Android Runtime: Contains the Dalvik/ART virtual
machine.
• Application Framework: Manages UI, resources, and
activity lifecycle.
• . Applications: User-facing apps built using Android
SDK.
Android Architecture
Android Development Tools
• - Android Studio: Official IDE for Android
development.
• - Android SDK: Provides tools and libraries for
app creation.
• - Emulator: Virtual device for testing apps.
• - Build Tools: Gradle for build automation.
Components of an Android Application
• 1. Activities: Handles the UI and user
interaction.
• 2. Services: Background processing.
• 3. Broadcast Receivers: Respond to system-
wide events.
• 4. Content Providers: Share data between
applications.
Challenges of Android App
Common terms
• 1. Activity
• A single, focused task or screen in an app that the
user interacts with.
• Example: A login screen or a home screen.
• Fragment
• A modular section of an Activity that can be reused
and managed independently.
• Allows for a more dynamic and flexible user interface.
• Intent
• A messaging object used to request an action
from another app component.
• Example: Launching a new Activity or sharing
data with another app.
• RecyclerView
• A flexible and efficient way to display a large
list of data.
• It is an advanced version of the ListView and
allows better performance with customization.
• View
• The basic building block of the user interface
in Android.Examples: Button, TextView,
ImageView.
• Layout
• A structure that defines the arrangement of
views on the screen.Examples: LinearLayout,
RelativeLayout, ConstraintLayout.
• Manifest
• The AndroidManifest.xml file contains
essential information about the app, such as:
• App name.
• Permissions (e.g., accessing the camera).
• Activities and services declared.
• Gradle
• A build automation tool used to compile,
build, and manage dependencies in an
Android project.
• APK (Android Package Kit)The file format for
distributing and installing Android
apps.Example: An APK file is like a .exe file for
Windows.10.
• SDK (Software Development Kit)A collection of
tools, libraries, and documentation required
to develop Android applications.
• Context
• Provides access to application-specific resources
and services, such as databases, shared
preferences, and UI elements.
• Service
• A component that runs in the background to perform
long-running operations without user
interaction.Example: Playing music in the background.
• Broadcast Receiver
• A component that listens for system-wide or app-
specific broadcast messages.Example: Listening for
battery low notifications or incoming SMS.
• Content Provider
Manages access to a structured set of data from
other apps.Example: Accessing contacts or shared
databases.
. Emulator
A virtual device that mimics an Android device,
used for testing apps on a PC.
ADB (Android Debug Bridge)
A command-line tool to communicate with an
emulator or connected device for debugging and
testing.
• ANR
(Application Not Responding)Occurs when the app
becomes unresponsive for too long due to blocked UI
threads.
Material Design
A design language developed by Google to provide
consistent UI/UX across apps.
ViewModel
Part of Android's Jetpack library. Helps manage UI-related
data in a lifecycle-aware way.
ProGuard
A tool to shrink, optimize, and obfuscate code for better
performance and security.
Activity life cycle
Steps to Develop an Android App
• 1. Set up Android Studio and SDK.
• 2. Create a new project and choose a template.
• 3. Design the user interface in XML.
• 4. Write business logic in Java/Kotlin.
• 5. Test the app using the emulator or a physical
device.
• 6. Debug, build, and deploy the app to the Play
Store.
Some important files and folders
• The android project contains different types of app
modules, source code files, and resource files. We will
explore all the folders and files in the android app.
• Manifests Folder
• Java Folder
• res (Resources) Folder
• Drawable Folder
• Layout Folder
Mipmap Folder
Values Folder
Gradle Scripts
Manifests Folder
• Manifests folder contains
AndroidManifest.xml for creating our android
application. This file contains information
about our application such as the Android
version, metadata, states package for Kotlin
file, and other application components. It acts
as an intermediator between android OS and
our application.
• Following is the manifests folder structure in
the android application.
Java folder
• Java folder
• The Java folder contains all the java and Kotlin
source code (.java) files that we create during
the app development, including other Test
files. If we create any new project using Kotlin,
by default the class file MainActivity.kt file will
create automatically under the package name
“com.geeksforgeeks.myfirstkotlinapp” as
shown below.
• Resource (res) folder
• The resource folder is the most
important folder because it contains
all the non-code sources like images,
XML layouts, and UI strings for our
android application.
res/drawable folder
• It contains the different types of images used
for the development of the application. We
need to add all the images in a drawable
folder for the application development.
res/layout folder
• The layout folder contains all XML layout files
which we used to define the user interface of
our application. It contains the
activity_main.xml file.
res/mipmap folder
• This folder contains launcher.xml files to
define icons that are used to show on the
home screen. It contains different density
types of icons depending upon the size of the
device such as hdpi, mdpi, xhdpi.
res/values folder
• Values folder contains a number of XML files
like strings, dimensions, colors, and style
definitions. One of the most important files is
the strings.xml file which contains the
resources.
Gradle Scripts folder
• Gradle means automated build system and it
contains a number of files that are used to
define a build configuration that can be
applied to all modules in our application. In
build.gradle (Project) there are buildscripts
and in build.gradle (Module) plugins and
implementations are used to build
configurations that can be applied to all our
application modules.
•
layout
In Android development, layouts define the structure of the user interface
(UI). Here are the main types of layouts and their meanings:
• LinearLayout
• Arranges child views in a single direction: either vertically or horizontally.
• Example: A list of buttons stacked on top of each other.
• RelativeLayout (Deprecated in favor of ConstraintLayout)
• Positions child views relative to each other or the parent layout.
• Example: A button positioned below a text view.
• ConstraintLayout (Recommended for complex UIs)
• Allows flexible positioning using constraints, reducing nesting and
improving performance.
• Example: A UI with multiple elements aligned responsively.
4.FrameLayout
•A container for holding a single child view or overlapping views.
•Example: A loading spinner over an image.
5.TableLayout
•Organizes child views in rows and columns, similar to an HTML table.
•Example: A form with input fields and labels.
6.GridLayout
•Arranges child views in a grid-like structure, offering more control over
column and row spans.
•Example: A calculator app UI.
7.ScrollView (for vertical scrolling) & HorizontalScrollView (for
horizontal scrolling)
•Allows users to scroll when content exceeds the screen size.
•Example: A long text article or image gallery.
Each layout has its use cases, and ConstraintLayout is generally preferred
for modern UI design due to its flexibility and performance benefits
WRAP CONTENT AND MATCH PARENT
• In Android layouts, wrap_content and
match_parent are two commonly used values
for setting width and height in View
components.
• wrap_content The view will resize itself to fit
the content inside it.
• Example: A button will be only as big as its text
requires.
• Match_parent The view will expand to fill the
entire available space of its parent.
• Example: A button will stretch to fill the entire
screen width if placed inside a LinearLayout
Conclusion
• - Android provides a robust platform for app
development.
• - It supports a vast ecosystem of devices and
users.
• - Mastering Android development enables you
to create innovative apps.