Chapter 1 Programming Mobile
Chapter 1 Programming Mobile
Credits: 2
Teaching Methods: Lectures (L), Tutorials (T), Practical (P), Self-Personal Work (SPW)
Introduction to Android
Android architecture
o Linux Kernel
o Android Runtime
o Libraries
o Application Framework
Android application components
o Activities
o Services
o Broadcast Receivers
o Content Providers
Android application lifecycle
Overview of Android development tools (Android Studio, SDK, Emulator)
Smartphones
Tablets
Feature phones
Wearable devices (smart watches, bands)
Embedded mobile terminals (POS, industrial devices)
Comparison of mobile terminals based on hardware and OS
Chapter 1: Generalities on Mobile Terminals
A mobile terminal refers to a versatile and portable electronic device designed to facilitate a
range of functions such as communication, data input, processing, and display. These devices are
integral to modern operations, offering flexibility and efficiency across various industries and
applications.
From enhancing productivity in logistics and retail to improving patient care in healthcare and
streamlining processes in transportation, mobile terminals have become indispensable tools in
the digital age. Examples of mobile terminals include mobile data terminals (MDTs), portable
data terminals (PDTs), and smartphones, each tailored to meet specific industry needs while
supporting seamless connectivity and functionality.
Mobile terminals are multifunctional devices that support a wide range of activities. They enable
communication through voice calls, messaging, and internet access via cellular and Wi-Fi
networks. They also allow data processing, where users can collect, store, and analyze
information in real-time. With built-in GPS(Global Positioning System), mobile terminals
provide navigation capabilities for tracking locations and optimizing routes. Additionally, they
support various industry-specific applications, such as inventory management or dispatching, and
integrate seamlessly with other systems like ERP(Enterprise Resource Planning) or
CRM(Customer Relationship Management) for efficient data exchange.
After the Second World War, the evolution of mobile phone technology began to accelerate
rapidly. Engineers like Martin Cooper from Motorola were instrumental in moving the
technology forward. Cooper is widely recognized for creating the first handheld cellular phone.
What followed the development of this first phone, the Motorola DynaTAC, marked a significant
step in the mobile phone revolution.
While the first handset was a major breakthrough, it was the creation of the second phone which
signaled the start of a new era. This subsequent model took the fundamental principles of the first
mobile phone and aimed to enhance its design and functionality. Advancements in technology
allowed for improvements in battery life, signal strength, and overall usability.
Mobile phones have transformed from bulky, single-purpose devices into sleek, powerful mini-
computers that run our daily lives. Let’s walk through the key stages of this evolution.
1973: Motorola engineer Martin Cooper made the first mobile phone call on
the Motorola DynaTAC.
Phones were huge, heavy (“brick phones”), and only supported analog voice calls.
iPhone (2007) revolutionized mobile phones with touchscreens and the App Store.
Android (Google) emerged as the main competitor, leading to today’s Apple vs.
Android market.
Mobile payments.
Phones became multimedia hubs with HD cameras, GPS, and powerful processors.
AI became central:
Holographic communication.
Phones may evolve into wearables or implants, blurring the line between device and
user.
In the early 2000s, mobile applications were basic, often restricted to specific devices. However,
the launch of iOS and Android revolutionized the industry, introducing app stores and extensive
development tools that made app creation accessible to a broader audience. Today, Android and
iOS dominate the market, accounting for over 99% of global mobile operating system market
share, according to StatCounter.
A mobile application platform is a comprehensive environment that supports the entire lifecycle
of a mobile app, from development to deployment and maintenance. To effectively serve
developers and businesses, a mobile application platform must include several key components,
each playing a vital role in ensuring that apps are built efficiently, perform well, and can be
distributed and maintained effectively. Below are the key components of a mobile application
platform:
The IDE is the primary tool that developers use to write, test, and debug their applications. It
often includes a code editor, a compiler or interpreter, and a debugger.
Examples: Xcode for iOS, Android Studio for Android, and Visual Studio for MAUI (formerly
Xamarin).
Importance: A robust IDE streamlines the development process by providing tools and features
like code autocompletion, syntax highlighting, and integrated testing environments. This allows
developers to focus on writing code and solving problems rather than configuring their tools.
Importance: SDKs provide developers with the necessary resources to access native features of
a platform, such as cameras, GPS, and sensors. They also include APIs that simplify complex
tasks like networking, data storage, and user interface design.
APIs are sets of protocols and tools that allow different software components to communicate
with each other. In mobile application platforms, APIs are used to connect apps with external
services or platform-specific features.
Examples: Google Maps API, Facebook Login API, Apple Pay API.
Importance: APIs enable developers to integrate third-party services and functionalities into
their apps, such as social media sharing, payment processing, and cloud storage. This not only
extends the capabilities of an app but also saves development time by leveraging existing
solutions.
UI frameworks provide the tools and libraries needed to create the visual elements and layout of
an app, including buttons, menus, and navigation structures.
Examples: SwiftUI for iOS, Jetpack Compose for Android, React Native for cross-platform
development.
Importance: A good UI framework simplifies the process of designing and implementing user
interfaces, ensuring that the app is both visually appealing and easy to use. These frameworks
often include pre-built components that are optimized for performance and consistency across
different devices.
These tools help developers identify and fix issues in their apps before they are released. They
can simulate different devices, test app performance under various conditions, and detect bugs.
Examples: Xcode’s Simulator, Android Emulator, Appium for automated testing.
Importance: Testing and debugging tools are critical for ensuring that apps are stable, secure,
and perform well across different devices and operating system versions. They help developers
catch and fix issues early in the development process, reducing the risk of costly errors in
production.
These are platforms where developers can publish their apps, making them available for
download by users. They also handle app updates, user reviews, and monetization.
Importance: Distribution channels are the primary way that apps reach users. They also provide
valuable analytics and feedback that developers can use to improve their apps.
Additionally, app stores often enforce quality and security standards, ensuring that only safe and
reliable apps are available to users.
Importance: BaaS simplifies backend development by offering ready-to-use services that scale
with app demand. This allows developers to focus on frontend development and user experience,
rather than managing servers and databases.
8. Security Tools
Security tools are used to protect apps from threats like data breaches, unauthorized access, and
malware.
Examples: SSL/TLS encryption, OAuth for secure authentication, mobile security suites like
AppScan.
Importance: Security is a top priority for mobile apps, especially those handling sensitive user
data. Security tools help ensure that apps comply with industry standards and regulations,
protecting both the developer and the end-user.
These tools provide insights into how users interact with an app, tracking metrics such as user
engagement, retention rates, and in-app behavior.
platforms?
Mobile application platforms can be categorized into several types based on their underlying
technology and the environments they support. Each type has its own advantages and
disadvantages, making it suitable for different kinds of projects and business needs. Here are the
main types of mobile application platforms:
1. Native Platforms
Native platforms involve developing apps specifically for a single operating system, such as iOS
or Android. These apps are written in languages that are native to the platform—Swift or
Objective-C for iOS, and Java or Kotlin for Android.
iOS: Apple’s native platform for iPhone and iPad apps. Apps are developed using Swift
or Objective-C in Xcode.
Android: Google’s native platform for Android devices. Apps are developed using Java
or Kotlin in Android Studio.
Advantages:
Superior performance due to direct access to device hardware and system resources.
Enhanced user experience as the apps are optimized for the specific platform.
Disadvantages:
Higher development costs due to maintaining separate codebases for each platform.
Cross-platform development platforms allow developers to write code once and deploy it on
multiple platforms, such as iOS, Android, and sometimes even web. Popular frameworks include
React Native, Flutter, and Xamarin.
React Native: Developed by Facebook, React Native allows developers to build mobile
apps using JavaScript and React, with a single codebase that runs on both iOS and
Android. React Native app development remains the most popular form of building cross
platform apps worldwide.
Flutter: Created by Google, Flutter uses the Dart programming language and allows
developers to create natively compiled applications for mobile, web, and desktop from a
single codebase.
.NET MAUI: Owned by Microsoft, .NET MAUI is the successor of Xamarin and uses
C# and .NET, allowing developers to build cross-platform apps for iOS, Android, and
Windows.
Advantages:
Disadvantages:
May not offer the same level of performance or access to native features as native apps.
3. Hybrid Platforms
Hybrid platforms blend elements of native and web apps. They are built using web technologies
like HTML, CSS, and JavaScript and are wrapped in a native container that allows them to be
deployed as mobile apps. Frameworks like Apache Cordova and Ionic are popular for hybrid
development.
Ionic: A popular hybrid platform that builds on top of Apache Cordova and Angular.
Ionic allows developers to create apps with a single codebase that can be deployed across
multiple platforms.
Advantages:
Disadvantages:
Limited access to native device features and less optimized user experience.
Progressive Web Apps or PWA is a web applications that behave like a mobile app. They run in a
web browser but offer features like offline access, push notifications, and the ability to be
installed on a device’s home screen.
Google Lighthouse: A tool by Google that helps developers build Progressive Web Apps
(PWAs). PWAs run in a web browser but offer app-like experiences.
Workbox: Another Google tool that simplifies the creation of PWAs by handling
caching, routing, and other key functionalities.
Advantages:
No need for app store distribution, which can simplify the release process.
Disadvantages:
Specialized platforms and engines like Unity and Unreal Engine are used to develop mobile
games. These platforms offer tools and libraries specifically designed for creating high-
performance, interactive games.
Unity: A widely-used game development engine that allows developers to create 2D, 3D,
and VR games for various platforms, including mobile (iOS and Android), consoles, and
PCs.
Advantages:
Disadvantages:
Each type of mobile application platform has its own set of strengths, making them more or less
suitable depending on the project’s specific needs, budget, and target audience.
6. Low-Code/No-Code Platforms
These platforms allow users to create apps with minimal or no coding knowledge. They use
visual interfaces and pre-built components to assemble apps.
Appy Pie: Offers a drag-and-drop interface for building various types of apps.
Advantages:
Lower Development Costs: These platforms reduce the need for extensive coding
expertise, enabling non-developers or small teams to create applications.
Disadvantages:
Mobile applications today extend beyond basic functionality with cutting-edge technology
integration, including artificial intelligence, augmented reality, and machine learning. This
incorporation enhances the capabilities of mobile apps, offering users innovative and
personalized experiences.
1. User-Centric Design
User-centric design is pivotal in shaping successful mobile applications, ensuring they meet
the needs and preferences of users seamlessly. Firstly, Intuitive Navigation is a characteristic
that allows users to explore the app without confusion. Clear and concise menus, well-
defined buttons, and logical flow contribute to an optimal user experience, reducing the
learning curve and enhancing overall usability.
Another crucial aspect is Responsive Design, ensuring the application adapts to various
screen sizes and resolutions. Mobile users engage with devices of diverse specifications, and
a user-centric design prioritizes responsiveness, guaranteeing a consistent and enjoyable
experience across different devices. This adaptability enhances user satisfaction and
addresses the dynamic nature of the mobile landscape.
2. Efficient Performance
Furthermore, regular updates and performance monitoring are crucial for maintaining
efficiency over time. By staying attuned to user feedback and technological advancements,
developers can continuously refine the application's performance, ensuring it meets the
evolving user expectations and leverages the latest capabilities of mobile devices.
3. Reliable Security Measures
4. Cross-Device Compatibility
5. Offline Functionality
In the realm of mobile applications, one of the characteristics of mobile application is the
offline functionality. It has emerged as a crucial characteristic, providing users uninterrupted
access to essential features even when internet connectivity is limited or nonexistent. This
capability enables users to engage with the application seamlessly, ensuring a consistent and
reliable user experience regardless of the location or connectivity status.
6. Intuitive Navigation
Effective intuitive navigation encompasses clear and concise labels, logical placement of
essential elements, and a user-friendly flow. Visual cues such as icons, color coding, and
gesture-based controls contribute to a more intuitive experience, allowing users to understand
how to navigate the application instinctively.
7. Effective Onboarding
8. Scalability
Scalability is one of the vital characteristics of mobile application, ensuring they can adapt
and handle varying workloads effectively. Firstly, horizontal scalability is vital as it enables
the app to efficiently distribute tasks across multiple servers, accommodating a growing user
base without sacrificing performance. This approach ensures that as user demand increases,
the application can seamlessly scale by adding more resources and maintaining
responsiveness and reliability.
Furthermore, vertical scalability is equally crucial, allowing the mobile application to handle
increased load by enhancing the capabilities of individual servers. It involves optimizing the
performance of each server component, such as increasing processor speed or memory
capacity. Vertical scalability ensures that the application can efficiently manage spikes in user
activity and resource-intensive tasks.
Another essential aspect of clear and concise communication in mobile applications is the
succinct and jargon-free language use. Error messages and prompts should be transparent,
providing users with actionable information to resolve issues quickly. By prioritizing
simplicity in design and language, developers can foster positive user interaction, making the
mobile application more accessible and user-friendly.
Battery Constraints
Mobile devices operate on limited battery capacity, typically between 2,000 to 5,000 mAh,
which must power all components for an entire day. This finite energy source fundamentally
shapes mobile application design. Unlike desktop applications that assume unlimited power from
wall outlets, mobile apps must treat battery life as a precious, rapidly depleting resource. Every
computation, every network call, and even keeping the screen illuminated contributes to battery
drain. The challenge is compounded by the fact that users carry their phones everywhere and
expect them to remain functional throughout their waking hours, often without access to
charging during the day.
Real-World Example:
Consider a fitness tracking application that monitors a user's morning run. If the app
continuously uses GPS at high accuracy, keeps the screen brightly lit, and constantly processes
sensor data from the accelerometer and gyroscope, it might drain 30-40% of the battery during a
one-hour run. This leaves the user with significantly less battery for the rest of their day's
activities. A well-designed app, however, might sample GPS data at intelligent intervals rather
than continuously, use the ambient light sensor to dim the screen when not actively viewed, and
process sensor data in batches rather than real-time. These optimizations could reduce the same
run's battery consumption to just 10-15%, dramatically improving the user's overall device
experience.
Memory Constraints
Mobile devices, despite their increasing sophistication, operate with significantly less RAM than
desktop computers—typically 4GB to 12GB compared to a desktop's 16GB to 32GB. This
limited memory must be shared between the operating system, background services, and all
running applications. When an app exceeds its memory allocation, the operating system may
terminate it abruptly, causing data loss and poor user experience. Memory management is further
complicated by the diversity of device capabilities—developers must create apps that function
well on both budget devices with minimal RAM and premium devices with more generous
allocations.
Real-World Example:
A photo editing application demonstrates memory challenges effectively. When a user opens a
high-resolution 12MP image (approximately 36MB uncompressed), the app must load this into
memory along with its editing tools, filters, and undo history. On a device with 4GB RAM where
the system and other apps already consume 3GB, the photo editor has only about 1GB to work
with. A poorly optimized app might load the entire image at full resolution immediately,
consuming most available memory and risking crashes when the user applies filters (which
create additional memory buffers). A well-architected app might instead use pyramid tiling—
loading only the portion of the image currently being viewed at full resolution while keeping
other parts at lower resolution—or implement intelligent caching that purges unused filter effects
from memory when pressure increases.
Real-World Example:
An email client application illustrates screen size challenges perfectly. On a desktop application,
designers have the luxury of showing the folder list, email list, and email content all
simultaneously in a three-pane layout. On a mobile device's 6-inch screen, displaying all three
elements simultaneously would make each panel too small to read and the touch targets too tiny
to accurately press. A well-designed mobile email client must therefore implement adaptive
navigation—perhaps showing only the email list initially, then expanding to show content when
an email is selected, with a hamburger menu to access folders. The app must also handle
landscape orientation intelligently, possibly showing two panels (list and content) side-by-side
when space allows, but reverting to single-panel in portrait mode. These adaptations must work
seamlessly across devices ranging from a 4.7-inch iPhone SE to a 7.6-inch Galaxy Fold
unfolded.
Connectivity Constraints
Mobile devices experience fundamentally different network conditions than their wired
counterparts. Connectivity is intermittent—moving between Wi-Fi and cellular networks,
entering buildings with poor reception, traveling through tunnels or remote areas, and constantly
switching between different cellular towers. Bandwidth fluctuates dramatically, from high-speed
5G connections delivering hundreds of megabits per second to 2G edge networks struggling with
dial-up speeds. Latency varies unpredictably, and data transfer often incurs monetary costs for
users on metered plans. These conditions demand applications that can function without constant
connectivity and handle network failures gracefully.
Real-World Example:
A ride-sharing application like Uber or Lyft faces extreme connectivity challenges. When a user
requests a ride, they might start with strong 5G connectivity, but as they move toward the pickup
location, they could enter an underground parking garage with no signal, then emerge to spotty
3G coverage, and finally connect to a free but unreliable public Wi-Fi network. A poorly
designed app might fail completely when connectivity drops, leaving the user uncertain if their
ride is still coming and unable to contact their driver. A robust implementation, however, would
use offline-first architecture—confirming the ride booking immediately and storing it locally,
continuing to show the user's location and route on cached maps even without connectivity,
queuing messages to the driver for when connectivity resumes, and providing clear status
indicators about connection quality. The app might also minimize data usage by sending only
essential location updates at intelligent intervals rather than constant streaming.
Real-World Example:
A mobile video editing application trying to render a 4K video faces processing limitations
starkly. On a desktop with active cooling (fans) and a 65W+ processor, this task might complete
in minutes. On a mobile device with a passive cooling system (no fan) and a 5W processor, the
same task could take much longer and cause the device to become uncomfortably hot to hold. A
sophisticated mobile video editor would therefore implement progressive rendering—allowing
the user to preview effects at lower resolution first, using hardware-accelerated codecs
specifically designed for mobile processors, and breaking the rendering into chunks with cooling
periods between them. It might also detect when the device is getting too hot and suggest
pausing the export until it cools down, preventing thermal throttling from degrading performance
even further.
Storage Limitations
Mobile devices offer limited storage compared to computers—typically 64GB to 512GB, with a
significant portion already occupied by the operating system and pre-installed apps. Unlike
desktops where users can easily add external hard drives, mobile storage is generally fixed
(though some Android devices support expandable storage via microSD cards). Storage speed
varies dramatically between devices, with some using faster UFS storage and others slower
eMMC. Additionally, apps must respect user choice regarding storage location—internal storage
versus external SD card—and handle the case where external storage might be unexpectedly
removed.
Real-World Example:
A podcast application that downloads episodes for offline listening demonstrates storage
challenges. If the app automatically downloads every new episode from subscribed podcasts
without management, it could quickly consume tens of gigabytes on a device with only 64GB
total storage. This might prevent the user from taking photos or installing other applications. A
well-designed podcast app would implement intelligent storage management—allowing users to
set storage limits, automatically deleting played episodes, offering different quality settings for
downloads (lower bitrate for smaller files), and warning users when storage is running low. It
would also handle the technical complexity of allowing downloads to an SD card while
maintaining proper database tracking of file locations, even if the SD card is temporarily
removed.
Security and Privacy Requirements
Mobile devices contain extremely sensitive personal data—location history, messages, photos,
financial information, biometric data—and are vulnerable to physical theft or loss in ways
desktop computers rarely are. This creates extraordinary security requirements: data must be
encrypted both in transit and at rest, applications must authenticate users appropriately, and
permissions must be granted granularly. Privacy expectations have also escalated dramatically,
with users demanding transparency about data collection and the ability to control it. Platform-
specific requirements like Apple's App Tracking Transparency and Google's Privacy Sandbox
add additional compliance layers that vary between ecosystems.
Real-World Example:
A mobile banking application operates under extreme security constraints. The app must
authenticate users securely without making the process overly cumbersome—often using
biometric authentication (fingerprint or face recognition) backed by secure hardware elements
like the Trusted Execution Environment. It must encrypt all communication using TLS with
certificate pinning to prevent man-in-the-middle attacks. Sensitive data like account balances and
transaction histories must be stored encrypted on the device. The app must also handle scenarios
like device theft by implementing remote wipe capabilities and detecting when the device has
been jailbroken or rooted (which compromises security). All this must be accomplished while
maintaining a smooth user experience—if security measures are too intrusive, users may
abandon the app for a competitor with better UX.
Platform Fragmentation
Unlike desktop development where developers might target Windows 10 and 11, or web
development where standards are relatively consistent across browsers, mobile development
faces extreme platform fragmentation. On Android alone, developers must account for thousands
of device models from hundreds of manufacturers, each with different hardware capabilities,
screen dimensions, and custom Android modifications. Multiple Android versions remain in
active use simultaneously, from several years old to the latest release. iOS is more controlled but
still requires supporting multiple generations of iPhones and iPad models with different
capabilities. This fragmentation requires extensive testing and often results in code complexity to
handle different device capabilities gracefully.
Real-World Example:
A mobile game developer releasing a graphically intensive game faces fragmentation challenges
at every level. The game might use Vulkan graphics API for best performance, but many older
Android devices don't support Vulkan, requiring a fallback to OpenGL ES. Some devices have
powerful GPUs capable of rendering at 90Hz or 120Hz refresh rates, while others struggle with
30Hz at lower resolutions. Device-specific bugs are common—a particular phone model might
have a driver bug that causes graphical artifacts unless a specific workaround is implemented.
Audio systems vary between devices, with some supporting advanced spatial audio and others
having basic stereo output. The developer must either limit their audience to high-end devices or
invest significant engineering time creating adaptive graphics settings, multiple rendering paths,
and extensive device-specific testing and workarounds.
Real-World Example:
A navigation application like Google Maps or Apple Maps exemplifies adaptive interaction
design. The app must accommodate one-handed use with thumb-accessible controls placed in the
lower half of the screen, while also supporting two-handed interaction for more complex tasks. It
interprets various gestures: a single finger drag to pan the map, two-finger pinch to zoom, two-
finger rotate to change orientation, and potentially harder-to-discover gestures like two-finger tilt
to change perspective. The app uses multiple sensors simultaneously: GPS for location,
accelerometer and gyroscope to determine which direction the user is facing (for augmented
reality walking directions), magnetometer to calibrate the compass, and ambient light sensor to
adjust screen brightness in tunnels. All these interactions must feel intuitive and responsive
despite the computational complexity happening in the background, and the app must handle
interruptions gracefully when a phone call comes in or the user switches momentarily to another
app.
Android represents one of the most significant technological ecosystems of the 21st century,
transforming how billions of people interact with technology daily. At its core, Android is an
open-source, Linux-based operating system designed primarily for touchscreen mobile devices
such as smartphones and tablets. However, its reach has expanded far beyond phones to power
smartwatches, televisions, cars, home appliances, and even embedded systems. Understanding
Android is not just about learning a mobile platform—it's about engaging with a global
technological phenomenon that has democratized access to computing worldwide.
Android operating system is the largest installed base among various mobile platforms across
the globe. Hundreds of millions of mobile devices are powered by Android in more than 190
countries of the world. It conquered around 71% of the global market share by the end of 2021,
and this trend is growing bigger every other day. The company named Open Handset
Alliance developed Android for the first time that is based on the modified version of the Linux
kernel and other open-source software. Google sponsored the project at initial stages and in the
year 2005, it acquired the whole company. In September 2008, the first Android-powered device
was launched in the market. Android dominates the mobile OS industry because of the long list
of features it provides. It's user-friendly, has huge community support, provides a greater extent
of customization, and a large number of companies build Android-compatible smartphones. As a
result, the market observes a sharp increase in the demand for developing Android mobile
applications, and with that companies need smart developers with the right skill set. At first, the
purpose of Android was thought of as a mobile operating system. However, with the
advancement of code libraries and its popularity among developers of the divergent domain,
Android becomes an absolute set of software for all devices like tablets, wearables, set-top
boxes, smart TVs, notebooks, etc.
Features of Android
Android is a powerful open-source operating system that open-source provides immense features
and some of these are listed below.
Android is an Open Source Project so we can customize the OS based on our
requirements.
Android supports different types of connectivity for GSM, CDMA, Wi-Fi, Bluetooth, etc.
for telephonic conversation or data transfer.
Using wifi technology we can pair with other devices while playing games or using other
applications.
We can manage all data storage-related activities by using the file manager.
It contains a wide range of media supports like AVI, MKV, FLV, MPEG4, etc. to play or
record a variety of audio/video.
It also supports different image formats like JPEG, PNG, GIF, BMP, MP3, etc.
Android has an integrated open-source WebKit layout-based web browser to support User
Interfaces like HTML5, and CSS3.
Android supports multi-tasking means we can run multiple applications at a time and can
switch between them.
Android Versions
Google first publicly announced Android in November 2007 but was released on 23
SEPTEMBER 2008 to be exact. The first device to bring Android into the market was the HTC
Dream with the version Android 1.0. Since then, Google released a lot of android versions such
as Apple Pie, Banana Bread, Cupcake, Donut, Éclair, Froyo, Gingerbread, Jellybeans, Kitkat,
Lollipop, marshmallow, Nougat, Oreo, etc. with extra functionalities and new features.
Android architecture contains a different number of components to support any Android device's
needs. Android software contains an open-source Linux Kernel having a collection of a number
of C/C++ libraries which are exposed through application framework services. Among all the
components Linux Kernel provides the main functionality of operating system functions to
smartphones and Dalvik Virtual Machine (DVM) provide a platform for running an Android
application.
Applications
Application Framework
Android Runtime
Platform Libraries
Linux Kernel
Pictorial representation of Android architecture with several main components and their sub-
components
Understanding Android's architecture is essential for building efficient applications. For those
looking to master this structure and move from beginner to advanced skills in Kotlin,
the Android Mastery with Kotlin: Beginner to Advanced course offers a comprehensive
guide
1. Applications
Applications is the top layer of android architecture. The pre-installed applications like home,
contacts, camera, gallery etc and third party applications downloaded from the play store like
chat applications, games etc. will be installed on this layer only. It runs within the Android run
time with the help of the classes and services provided by the application framework.
2. Application framework
The Application Framework is a core part of Android that gives developers the tools and services
they need to build apps. It provides access to device features like hardware, screen display, and
system resources. It includes several important services that make it easier to build powerful and
consistent Android apps without having to create everything from scratch. The services are as
follows:
1. Activity Manager - Manages the app’s activities and their life cycle (like opening,
pausing, or closing screens).
2. Notification Manager - Allows apps to show alerts or updates to the user.
3. Package Manager - Keeps track of all the apps installed on the device.
4. Window Manager - Handles the placement and appearance of windows on the screen.
5. Content Providers - Help apps share data with other apps (like contacts or photos).
6. View System - Controls how things (like buttons or text) appear on the screen.
3. Application runtime
Android Runtime environment is one of the most important part of Android. It contains
components like core libraries and the Dalvik virtual machine(DVM). Mainly, it provides the
base for the application framework and powers our application with the help of the core libraries.
Like Java Virtual Machine (JVM), Dalvik Virtual Machine (DVM) is a register-based virtual
machine and specially designed and optimized for android to ensure that a device can run
multiple instances efficiently. It depends on the layer Linux kernel for threading and low-level
memory management. The core libraries enable us to implement android applications using the
standard JAVA or Kotlin programming languages.
4. Platform libraries
The Platform Libraries includes various C/C++ core libraries and Java based libraries such as
Media, Graphics, Surface Manager, OpenGL etc. to provide a support for android development.
Media library provides support to play and record an audio and video formats.
Surface manager responsible for managing access to the display subsystem.
SGL and OpenGL both cross-language, cross-platform application program interface
(API) are used for 2D and 3D computer graphics.
SQLite provides database support and FreeType provides font support.
Web-Kit This open source web browser engine provides all the functionality to display
web content and to simplify page loading.
SSL (Secure Sockets Layer) is security technology to establish an encrypted link
between a web server and a web browser.
5. 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.
Memory Management: It efficiently handles the memory management thereby
providing the freedom to develop our apps.
Driver Model: It ensures that the application works properly on the device and hardware
manufacturers responsible for building their drivers into the Linux build.
There are few commonly used Android Architectures used mentioned below:
MVC or Model View Controller breaks the model into three main components Model that stores
the application data , View UI layer that holds the component visible on the screen
and Controller that establishes the relationship between Model and the View.
Communication between the View-Presenter and Presenter-Model happens with the help
of Interface (also called Contract).
There is One to One relationship between Presenter and View , One Presenter Class only
manages One View at a time.
Model and View doesn't have any knowledge about each other.
MVVM or Model View ViewModel as the name suggest like MVC model it contains three
components too Model , View and ViewModel. Features of MVVM model are mentioned below:
Benefits of Architecture
Bugs can be identified and removed easily with the well defined process.
There are some necessary building blocks that an Android application consists of. These loosely
coupled components are bound by the application manifest file which contains the description of
each component and how they interact. The manifest file also contains the app’s metadata, its
hardware configuration, and platform requirements, external libraries, and required permissions.
There are the following main components of an android app:
1. Activities
Activities are said to be the presentation layer of our applications. The UI of our application is
built around one or more extensions of the Activity class. By using Fragments and Views,
activities set the layout and display the output and also respond to the user's actions. An activity
is implemented as a subclass of class Activity.
2. Services
Services are like invisible workers of our app. These components run at the backend, updating
your data sources and Activities, triggering Notification, and also broadcast Intents. They also
perform some tasks when applications are not active. A service can be used as a subclass of class
Service:
3. Content Providers
It is used to manage and persist the application data also typically interacts with the SQL
database. They are also responsible for sharing the data beyond the application boundaries. The
Content Providers of a particular application can be configured to allow access from other
applications, and the Content Providers exposed by other applications can also be configured.
A content provider should be a sub-class of the class ContentProvider.
4. Broadcast Receivers
They are known to be intent listeners as they enable your application to listen to the Intents that
satisfy the matching criteria specified by us. Broadcast Receivers make our application react to
any received Intent thereby making them perfect for creating event-driven applications.
To read more, refer to the article: Broadcast Receiver in Android With Example
5. Intents
6. Widgets
These are the small visual application components that you can find on the home screen of the
devices. They are a special variation of Broadcast Receivers that allow us to create dynamic,
interactive application components for users to embed on their Home Screen.
7. Notifications
Notifications are the application alerts that are used to draw the user’s attention to some
particular app event without stealing focus or interrupting the current activity of the user. They
are generally used to grab user’s attention when the application is not visible or active,
particularly from within a Service or Broadcast Receiver. Examples: E-mail popups, Messenger
popups, etc.
As an android developer, if one does not know the application lifecycle of android application or
does not have in-depth knowledge about it, there are very high chances that the application will
not have a good user experience. Not having proper knowledge of the application lifecycle will
not affect the working of that application but it will lead to poor user experience. Let's take one
example where the user is using the application, which takes a high amount of battery usage and
on the other hand there is one another same application providing the same functionalities
offered by the previous app, then there are very high chances that the user will shift to later
application and will not be using the previous app. Having a lot of battery usage by the app can
be the indication that the android developer of that app does not have proper knowledge of the
application lifecycle.
This is an important topic and mandatory need to have proper knowledge of the processes in the
android and application lifecycle and how different processes can affect the application state.
The knowledge of the Application Lifecycle in Android is also a must because without having
proper knowledge many times the process can be crashed while doing some important work
which will ultimately lead to a bad impression of the app on the users. The lifecycle of the
application's process is not solely controlled by the application itself, but the application's
process lifetime depends on the various numbers of factors such as memory taken by the
application, memory available in the system, how important is the process from the perspective
of the user, how long it had been since the user not used that application.
Knowing the Application lifecycle is necessary as though it will not affect the working of the
app, but it will affect the user experience. Let say the user has two option in which user has the
choice to choose one app of out two, in which both the application offers the same functionality,
and involving the same type of task, but one app consumes more battery usage than the other, so,
surely, the user will go for the application which consumes less battery. Thus developers need to
understand the application is not holding resources and services when it is not in use, as it can be
the cause of more battery usage. Thus developers should handle each application state of the
android app and should release the resources when the app is in the background state.
As it is known that a particular android device has limited storage capacity and processing speed,
but since there are so many applications running on the user device, it becomes challenging for
the android operating system to manage the resource properly so that none of the resources
become a deficit of resource. So android operating system pushes the least used application in a
cache called as LRU (Least Recently Used) Cache, if the application has not been used for the
very long time, it will be pushed to the queue of the LRU and will be present at the front of the
queue. If the application comes into use in the near time, it will be near to the back of the queue,
and if the application is most recently used it will be present at the back of the queue. For
example, if the user has not used Facebook for a very long time, then the Facebook application
will be present at the front of the queue and if let's suppose the user has used WhatsApp recently,
then it will be present at the back of the LRU Cache queue. The LRU Cache Queue can be
diagrammatically represented as:
To determine which process should be killed to proper memory and battery management, the
Android operating system maintains a hierarchy in which all the processes are placed in order of
their priority. The less priority is the process which can be killed first when the system wants to
free up some resource. Android uses some set of rules and regulations to decide the priority of
the processes based on the running state of the applications. Below are the process states that a
process may have at any time in android applications. The priority of these processes
decreases from top to down in order in which they are listed.
1. Foreground process
A foreground process is a process with which the user is currently interacting and using it. A
process is considered to be in the foreground state if any of the below conditions hold:
Example: Imagine the user is using Whatsapp, so the Whatsapp app will be said to be in the
foreground state. This process is of the highest priority and they can only be killed by the system
if the memory is so low that even this process cannot continue their execution.
2. Visible process
A visible process is a process when the activity can be visible to the user. The user does not
directly interact with this process, as the activity corresponds to this process would be covered
partially by another activity and the process will be in the onPause() lifecycle state. This process
cannot be killed unless there is so much lack of memory in the system that the execution of these
processes cannot be possible. Killing these processes will create a negative impact on user
experience, as a user can see the activity corresponding to this process. These processes would
be killed only when keeping them alive make it impossible for the foreground process to
continue their execution.
Example: When some application needs permission like camera access, storage access, etc a
prompt or dialog box will appear and ask for the required permission. So at this time, the process
corresponding to the activity of the app which is running previously will go in the visible state.
3. Service Process
A process is said to be a service process if it is in running state and neither a foreground process
and a visible process. These processes are not directly visible to the user of the application. This
process is helpful for the applications which perform the background tasks such as background
network data upload or download. The system will keep the service process alive until it
becomes impossible for the system to keep the foreground process and visible process running.
Example: Uploading a PDF on the Whatsapp from the desktop is a service process that is done
in the background.
4. Background process
A background state in which the onStop() lifecycle method of android is called by the system.
Let's suppose the user is using an app and suddenly presses the home button, so because of this
action, the process goes from foreground state to background state. When the app goes from
foreground state to background state, it goes to the LRU cache queue and will be placed in the
front of the [Link] the user returns to that app, the process will return from background
state to foreground state. So having knowledge of the process and application lifecycle in
android along with how processes can decide the lifecycle time of the application is a must for an
android developer which can lead to good user experience.
From the above image, it can be said that applications that offer the same type of services lead to
near about the same amount of battery consumption. (Consider the usage time of application to
be equal) From the above image, it can be seen that as Youtube and Google meets are both
Video Streaming and Linkedin and Whatsapp are both the same kinds of messaging app, though
a little bit different, but these apps use the same kind of data-transport and services, thus
consumes the same amount of battery.
Before going to the overview of Embedded Systems, Let's first know the two basic things i.e.,
embedded and system, and what actually do they mean.
Embedded means including something with anything for a reason. Or simply we can say
something which is integrated or attached to another thing. Now after getting what actual
systems and embedded mean we can easily understand what are Embedded Systems.
Digital watches
Washing Machine
Toys
Televisions
Digital phones
Laser Printer
Cameras
Industrial machines
Electronic Calculators
Automobiles
Medical Equipment
Home appliances
Transportation
Health care
Defense sector
Aerospace
Agricultural Sector
Performs specific task: Embedded systems perform some specific function or tasks.
Minimal User interface: These systems require less user interface and are easy to use.
Highly Stable: Embedded systems do not change frequently mostly fixed maintaining
stability.
High Reliability: Embedded systems are reliable they perform tasks consistently well.
Small size.
Top Embedded Programming Languages: Some of the programming languages used in the
development of embedded systems include, Embedded C, Embedded C + +, Embedded Java,
Embedded Python etc. But it completely rests on the developer which programming language he
selects for the development of the embedded systems.
Embedded systems operate from the combination of hardware and software that focuses on
certain operations. An embedded system at its heart has microcontroller or microprocessor
hardware on which user writes the code in form of software for control of the system. Here is
how it generally works:
Hardware Layer: Some of the hardware elements that are incorporated in an embedded
system include the sensor, actuator, memory, current I/O interfaces as well as power
supply. These components are interfaced with the micro controller or micro processor
depending up on the input signals accepted.
Input/Output (I/O) Interfaces: They to give the system input in form of data from
sensors or inputs made by the users and the microcontroller processes the data received.
The processed data is then utilized to coordinate the output devices such as displays,
motors or communication modules.
Processing: Depending on the given software and the input data received from the
system’s inputs the microcontroller calculates the appropriate output or response and
manages the system’s components.
Real-time Operation: Some of the most common systems are real time, this implies that
they have the ability to process events or inputs at given time. This real time capability
makes sure that the system accomplishes its intended function within stated time
demands.
For instance therein an embedded system in a washing machine, the microcontroller would
interface with the buttons (selections made by a user), sensors, for instance water levels,
temperature and timers; it would control outputs such as motors, heaters and displays among
others based on the program intended for washing cycles.
Embedded systems are special-purpose computers built into a larger device or product to
perform dedicated functions.
Mobile systems are general-purpose computers designed for portability and a wide range
of user applications.
Key Differences
IoT devices: Many are embedded systems, but smartphones act as their mobile
interface/control point.
Simple Analogy
Embedded system → The computer inside your microwave that controls timing and
power.
Mobile system → Your smartphone that you use to call, browse, play games, and also
control the microwave via an app.
What it is: The system must guarantee a response within a strict deadline (real-
time). Determinism means the worst-case execution time is known and predictable.
Why it's a constraint: You can't trade speed for convenience. A missed deadline is a
system failure.
Real-Life Example:
o Airbag Deployment System in a Car. From the moment a crash sensor detects
an impact, the airbag must inflate within ~10-50 milliseconds. The software
cannot afford to wait for a garbage collector to run, get stuck in a loop, or be
preempted by a less-critical task. Every line of code, every interrupt service
routine, is analyzed for its worst-case execution path. Using dynamic memory
allocation (malloc) is typically forbidden because its timing is unpredictable.
What it is: Embedded processors often have kilobytes (KB) of RAM and maybe a few
megabytes (MB) of Flash, not gigabytes (GB).
Why it's a constraint: Every byte costs money (in chip price, board size, and power).
Large memory is physically impossible in small, cheap, or low-power devices.
Real-Life Example:
What it is: Clock speeds are often in the tens or hundreds of MHz (not GHz), and the CPU
may lack advanced features like floating-point units (FPU).
Why it's a constraint: More processing power equals more heat and more power
consumption. The goal is to use the minimum capable processor to reduce cost and energy
use.
Real-Life Example:
o Digital Kitchen Scale. The microcontroller reads a strain gauge sensor signal,
filters the noise, averages the readings, and displays the weight on a simple LCD.
It runs at 16 MHz. Performing complex floating-point math for unit conversions
would be incredibly slow. Instead, it uses fixed-point arithmetic (treating
integers as decimals) for all calculations.
Programmer's Reality: They write highly optimized algorithms. They often use look-
up tables instead of complex calculations (e.g., for trigonometric functions). They
disable compiler optimizations that increase code size at the expense of speed, or vice
versa, depending on the primary constraint.
What it is: Many embedded systems are battery-powered or must operate on minimal
energy. Power is a primary design driver.
Why it's a constraint: The device might need to run for years on a single coin-cell
battery, or it might be solar-powered.
Real-Life Example:
o Wireless Soil Moisture Sensor in a farm field. It's in the middle of a field,
powered by a small battery and a solar panel. It sleeps 99.9% of the time,
drawing microamps (µA) of current. Every few hours, it wakes up
(drawing milliamps (mA)), reads the sensor, transmits a small packet of data via
LoRaWAN radio, and goes back to sleep. If the software gets stuck in an active
loop, the battery dies in days instead of years.
What it is: Embedded software directly reads from and writes to physical memory addresses
that control hardware peripherals (registers). There is no generic "Open File" abstraction.
Why it's a constraint: The software is married to the specific circuit board (PCB) it was
designed for. Changing the hardware pin a sensor is connected to requires a software
change.
Real-Life Example:
What it is: Systems are expected to run continuously for years without crashing and must
often fail safely.
Why it's a constraint: You can't just "reboot" a pacemaker, an industrial machine, or a
satellite. A failure can be catastrophic.
Real-Life Example:
Programmer's Reality: They design for fault tolerance. They implement defensive
programming (checking inputs, validating states). Code is often written to MISRA C or
similar safety standards that forbid risky language features. They perform extensive
testing, including stress testing and fault injection.
To put it simply:
Sensors are devices that detect and measure physical properties like temperature, light,
pressure, motion, or sound, and convert them into digital signals.
Actuators are devices that perform an action based on the signals they receive, such as
turning on a light, opening a valve, or moving a motor
Together, they form the backbone of sensing and actuation in IoT. Sensors provide the data,
and actuators respond to that data by taking action.
1. Sensing: A sensor collects data from the environment (for example, a temperature sensor
reads the room temperature).
3. Decision Making: Based on the analysis, a decision is made (e.g., if the temperature is
too high).
4. Actuation: The actuator receives the signal and performs an action (for example,
switching on the air conditioner).
This cycle of sensing and actuation in IoT enables devices to not only observe but also
interact with their surroundings in real time.
The main purpose of sensors and actuators in the Internet of Things is to connect the digital
and physical worlds.
For example, in a smart irrigation system, soil moisture sensors detect dryness, and actuators
activate water pumps to irrigate the field. Without this cycle, IoT devices would just sit idle,
unable to make real changes.
It’s easy to confuse the two, so let’s make the di difference between sensors and actuators in
the Internet of Things clear:
In short, sensors are the “eyes and ears” of IoT, while actuators are the “hands and legs.”
Now let’s look at the types of sensors and actuators in the Internet of Things.
Types of Sensors:
2. Proximity Sensors: Detect nearby objects, common in parking systems and smartphones.
3. Pressure Sensors: Monitor air or water pressure in industrial machines and medical
devices.
These are just a few common sensor types used in IoT. To get a deeper understanding of
overall sensor categories and examples, check out this guide on the types of sensors in IoT
Types of Actuators:
4. Thermal Actuators: Use heat to trigger mechanical action (like in fire sprinklers).
These categories show how sensor and actuator in IoT cover a wide range of applications.
Let’s see some examples of sensors and actuators in the Internet of Things in real-world
systems:
Smart Home:
Healthcare:
Smart Agriculture:
The applications are vast and expanding every day. Some common ones include:
Every IoT system you see today is built on the backbone of sensing and actuation in IoT.
Understanding sensors and actuators in IoT is just the beginning, what makes IoT truly
powerful is learning how devices, data, and actions come together to create smart systems.
An Internet of Things course can guide you through real-world applications like smart
homes, healthcare, and industrial automation, helping you see the bigger picture beyond
theory. With practical projects and hands-on learning, such a course makes complex IoT
concepts simple and prepares you to apply them effectively in different domains.
Mobile phones are intricate devices built from both hardware and software components that
work together to enable seamless functionality. Hardware components include the processor,
memory, display, battery, and camera, each playing a vital role in a phone’s performance,
durability, and usability.
On the software side, the operating system (OS) and various applications provide the interface
and capabilities that users experience daily. Understanding these components helps us appreciate
how modern mobile phones deliver powerful, high-speed performance while maintaining
portability and convenience.
Mobile Phone Hardware Components
Keypad
Microphone
Speaker
SIM card
Battery
USB port
Antenna
Memory unit (RAM, ROM)
Camera
CODEC
RF part
DAC/ADC
Baseband part (L1/Layer1/physical layer) running on DSP
Application/protocol layers running on CPU
ON/OFF switch
Bluetooth/GPS features
Mobile Phone RF Transceiver
As shown in the figure, every mobile phone will have an RF part which consists of an RF
frequency up-converter and RF frequency down-converter.
For the GSM system, the up-converter converts the modulated baseband signal (I and Q) either at
zero IF (Intermediate frequency) or some IF to RF frequency (890-915 MHz).
The RF down-converter converts the RF signal (935 to 960 MHz) to the baseband signal (I and
Q).
For GSM, GMSK modulation is used. There are two approaches employed in GSM Mobile
phone receiver, i.e., heterodyne or homodyne. The basic component used for frequency
conversion is the RF mixer.
It supports video formats e.g., MPEG-1 to MPEG-5. Mobile phones support CIF, and QCIF
video standard resolutions.
Mobile Phone OS (Operating System)
Mobile phone operating systems (OSs) are the software platforms that enable smartphones to
perform a wide range of tasks, from running apps to managing system resources.
The two most popular mobile OSs are Android and iOS. Android, developed by Google, is an
open-source platform used by various manufacturers like Samsung, Google, and Xiaomi,
providing extensive customization options and compatibility with numerous hardware
configurations.
Apple’s iOS, on the other hand, is a proprietary OS exclusive to iPhone devices, known for its
seamless integration with Apple’s ecosystem and a focus on security and user experience.
Mobile OSs rely on powerful CPUs to handle complex processes, multitasking, and high-
performance applications. Android devices typically run on CPUs like Qualcomm’s Snapdragon,
Samsung’s Exynos, and MediaTek’s Dimensity series, all designed for optimized speed,
graphics, and power efficiency. iPhones, meanwhile, run exclusively on Apple’s A-series Bionic
chips, such as the A17 Bionic, which deliver industry-leading performance tailored to iOS.
These processors enable mobile OSs to provide smooth experiences in gaming, multimedia, and
productivity tasks.
Battery
It is the only major source of power to make/to keep the mobile phone functional.
There are various types of batteries made of Nickel Cadmium (NiCd), Nickel Metal Hydride
(NiMH), based on lithium, Li-ion, and so on.
The major factors for designers are to reduce battery size, last for more talk time, and increase
battery life.
The battery comes usually with 3.6 or 3.7 voltage and 600mAh or 960 mAh ratings.
A Battery Charger is usually provided with the mobile phone to charge the mobile phone battery.
The Battery charger is an AC to DC converter.
Connectivity
To make data transfer fast enough between the mobile phone and other computing devices
(laptop, desktop, tablet) or between mobile and mobile, various technologies have evolved which
include WLAN, Bluetooth, USB, etc.
GPS (global positioning system) is used for location assistance and will enable google maps to
work efficiently.
Microphone and Speaker
Microphone: A microphone or mic converts air pressure variations (result of our speech) to an
electrical signal to couple on the PCB for further processing. Usually, in mobile phones, mics of
types condenser, dynamic, carbon, or ribbon are used.
Speaker: It converts the electrical signal to an audible signal (pressure vibrations) for human
beings to hear. This is often coupled with an audio amplifier to get the required amplification of
the audio signal.
It is also tied with a volume control circuit to change (increase or decrease) the amplitude of the
audio signal.
Camera
Now-a-days with almost all the mobile phone camera feature is available for one to click pictures
at various occasions. It is the major specification in increasing the cost of a mobile phone.
There are various mega pixel cameras for mobile phones available such as 12 mega pixels, 14
mega pixels, and even 41 mega pixels available in smartphones. This has become evident
because of advancements in sensor technology. If one wants to buy a low-cost mobile phone,
they usually go for a non-camera mobile phone.
Display and Keypad
Display: There are various display devices used in mobile phones such as LCD (liquid crystal
display), TFT (Thin-film transistor) screen, OLED (organic light emitting diode), TFD (thin film
diode), touch screen of capacitive and resistive type, etc.
Keypad: Earlier days keypad was simple matrix type keypad which contains numeric digits (0 to
9), alphabets (a to z), special characters and specific function keys. These has been designed for
various applications such as accepting call, rejecting call, cursor movement(left, right, top,down)
dialling number, typing name/sms/mms and so on.
Now-a-days keypad has been removed from the phone design and it has become part of mobile
phone software. It pops on the display screen itself which can be operated by user using touch of
a finger tip.