Android Development Framework – Notes for 10 Marks
Overview
The Android development framework is a comprehensive set of tools, libraries, and APIs
provided by Google to facilitate the creation of applications for Android devices. It is designed to
simplify the development process and ensure that apps are robust, efficient, and compatible
across a wide range of devices1235.
Key Components of the Android Framework
• Application Framework:
This layer provides the APIs needed to build Android apps. It enables developers to use
core system components and services in a modular and reusable way357.
• View System: Used to build user interfaces, including widgets like lists, text
boxes, and buttons.
• Resource Manager: Manages non-code resources such as layouts, graphics, and
localized strings.
• Notification Manager: Allows apps to display alerts in the status bar.
• Activity Manager: Manages the lifecycle and navigation of applications.
• Content Providers: Enable data sharing between apps, such as accessing contacts
or media files35.
• Runtime Environment:
Android applications run in a managed environment using the Android Runtime (ART) or
the older Dalvik Virtual Machine (DVM). ART uses ahead-of-time (AOT) and just-in-time
(JIT) compilation to optimize app performance and memory usage35.
• Core Libraries:
A set of Java-based libraries provides most of the functionality needed for app
development, including data structures, utilities, and networking157.
• Native Libraries:
Written in C/C++, these libraries provide low-level functionalities such as graphics
(OpenGL), database (SQLite), and media playback. Developers can access some of these
libraries through the Java API or directly using the Android NDK5.
• Linux Kernel:
The foundation of the Android OS, responsible for device drivers, memory management,
process management, and security5.
Popular Android Development Frameworks and Tools
• Android SDK: The official toolkit for developing Android apps, including emulators,
debuggers, and build tools6.
• Cross-Platform Frameworks:
• React Native: Uses JavaScript and native components for cross-platform
development.
• Flutter: Uses Dart language and a unique rendering engine for high-performance
apps.
• Xamarin, Ionic, PhoneGap, NativeScript: Allow development with shared
codebases across Android and other platforms4.
Features and Benefits
• Modular and reusable components.
• Rich set of APIs for UI, data, and device integration.
• Support for multiple programming languages (Java, Kotlin, C++).
• Strong security and performance optimizations.
• Large developer community and extensive documentation
Android SDK Features – Notes for 10 Marks
Introduction
The Android Software Development Kit (SDK) is a comprehensive collection of tools, libraries,
and APIs that enable developers to build, test, and deploy Android applications efficiently165.
Key Features of Android SDK
• Android Studio IDE
Android Studio is the official integrated development environment for Android. It
provides advanced code editing, debugging, and performance analysis tools,
streamlining the entire development workflow6.
• Emulator
The Android Emulator allows developers to test and run their applications on virtual
devices with different Android versions and configurations, eliminating the need for
multiple physical devices658.
• Rich Set of APIs
The SDK includes APIs for accessing device features such as camera, GPS, sensors,
notifications, and more, enabling the creation of feature-rich applications16.
• Extensive Libraries
A wide range of libraries are provided for user interface components, networking,
database management, and other core functionalities, reducing development time and
effort16.
• Gradle Build System
Android Studio uses Gradle for building and managing project dependencies, making the
build process flexible and efficient6.
• Testing and Debugging Tools
The SDK offers tools like DDMS (Dalvik Debug Monitor Server), Android Debug Bridge
(adb), and Lint for debugging, monitoring, and analyzing app performance and code
quality678.
• ProGuard
ProGuard is integrated for code shrinking, optimization, and obfuscation, helping reduce
APK size and improve security by removing unused code78.
• Backward Compatibility and Support Libraries
Android SDK provides support libraries to ensure apps work across different Android
versions, enhancing compatibility and user reach1.
• Documentation and Sample Code
Comprehensive documentation and sample projects are included to assist developers in
learning and implementing best practices1.
• Integration with Google Services
Google Play Services and APIs are integrated, allowing developers to add features like
maps, authentication, and cloud messaging easily
Step-by-Step: Installing and Running an Application in Android Studio
1. Download Android Studio
• Open a web browser and go to the official Android Studio download page.
• Click on “Download Android Studio.”
• Read and accept the license agreement, then download the installer suitable for your
operating system (Windows, macOS, or Linux)236.
2. Install Android Studio
• Locate the downloaded installer file (usually in your Downloads folder).
• Double-click the installer to begin installation.
• If prompted, allow the installer to make changes to your computer (User Account
Control dialog)236.
• Follow the setup wizard:
• Click “Next” to proceed through the steps.
• Accept default options unless you have specific preferences.
• Choose the installation location (default is recommended).
• Install the Android Virtual Device (AVD) component if prompted, as it is needed
for running apps on the emulator6.
• Click “Install” and wait for the process to complete.
• Click “Finish” to launch Android Studio236.
3. Initial Setup of Android Studio
• On first launch, you may be asked to import previous settings. Choose “Do not import
settings” if you are a new user5.
• The Setup Wizard will guide you through:
• Selecting the standard installation type.
• Choosing a UI theme (Light or Dark).
• Accepting SDK license agreements.
• Downloading additional SDK components (this may take some time)5.
4. Create a New Android Project
• In the “Welcome to Android Studio” window, click “Start a new Android Studio project.”
• Choose a project template (e.g., “Empty Activity”) and click “Next.”
• Enter project details: name, package name, save location, language (Java/Kotlin), and
minimum SDK version.
• Click “Finish” to create the project. Android Studio will set up the project files and
environment4.
5. Write or Edit Application Code
• Open the MainActivity file and design your app’s UI in the XML layout file or using
Jetpack Compose.
• Add your logic in the activity’s code as needed.
6. Run the Application
• To test the app, you need to run it on a device:
• Using Emulator: Click the “Run” button (green triangle). If no virtual device
exists, the AVD Manager will prompt you to create one. Follow the instructions to
set up an emulator and start it.
• Using Physical Device: Connect your Android device via USB, enable “Developer
Options” and “USB Debugging” on the device, and select it as the deployment
target4.
7. View the Application Output
• Once the app builds and deploys, it will launch automatically on the selected emulator
or device.
• You can interact with your app and see the results immediately.
Creating Android Virtual Devices (AVDs)
Introduction
An Android Virtual Device (AVD) is an emulator configuration that allows you to model an
Android device on your computer. It is essential for testing and running Android applications in
different device environments without needing physical devices.
Step-by-Step Process of Creating AVDs
1. Open Android Studio
• Launch Android Studio on your computer.
• Wait for the IDE to load completely.
2. Access the AVD Manager
• On the Android Studio toolbar, locate and click the AVD Manager icon (it looks like a
phone).
• Alternatively, go to Tools > Device Manager or Tools > AVD Manager from the top menu.
3. Start Creating a New AVD
• In the AVD Manager window, click on “Create Virtual Device…”.
• This opens the Virtual Device Configuration wizard.
4. Select Hardware Profile
• Choose a device definition from the list (e.g., Pixel 5, Nexus 5X, Tablet, Wear OS, TV,
etc.).
• You can also create a custom device profile if needed.
• Click Next after selecting the desired hardware.
5. Select a System Image
• Choose the Android version (system image) you want the emulator to run (e.g., Android
13.0, 12.0, etc.).
• If the desired system image is not downloaded, click Download next to it and wait for
the download to finish.
• Select the system image and click Next.
6. Configure AVD Settings
• Give your AVD a name for easy identification.
• Adjust device settings as needed:
• Orientation (Portrait/Landscape)
• RAM and Internal Storage
• Graphics (Hardware or Software)
• Camera and Network options
• Advanced settings can be configured by clicking Show Advanced Settings.
• Click Finish to create the AVD.
7. Launch the AVD
• The new AVD will appear in the AVD Manager list.
• Click the Play (green triangle) button next to the AVD to start the emulator.
• Wait for the virtual device to boot up; it behaves like a real Android device.
Here are the main types of Android applications with explanations:
1. Utility Applications:
These apps are designed to help users perform specific tasks or functions efficiently. Examples
include file managers, system optimizers, QR code scanners, and calculator apps. They focus on
practicality and often run in the background to assist with daily operations1.
2. Social Networking Applications:
Social networking apps enable users to connect, communicate, and share content with others.
Popular examples are Facebook, Twitter, Instagram, and LinkedIn. These apps foster social
interaction, networking, and community building by supporting messaging, media sharing, and
status updates1.
3. Entertainment Applications:
Entertainment apps provide users with various forms of amusement, such as streaming services
(Netflix, YouTube, Spotify), games, and eBook readers. Their primary goal is to deliver enjoyable
content, whether it’s watching videos, listening to music, playing games, or reading1.
4. Communication Applications:
These apps facilitate real-time communication through text, voice, or video. Examples include
WhatsApp, Messenger, Telegram, and Skype. They may also include email clients and VoIP apps,
making it easy for users to stay connected with others worldwide1.
5. Productivity Applications:
Productivity apps help users manage their work and personal tasks efficiently. Examples are
note-taking apps, document editors, calendars, and project management tools like Google
Drive, Microsoft Office, and Trello. They are essential for organizing schedules, collaborating,
and enhancing efficiency1.
6. Native Applications:
Native apps are developed specifically for the Android platform using Java or Kotlin. They offer
high performance, better integration with device hardware, and can work offline. WhatsApp is
an example of a native app, providing smooth user experience and full access to device
features3.
7. Hybrid Applications:
Hybrid apps are built using web technologies (HTML, CSS, JavaScript) and wrapped in a native
shell. They can run on multiple platforms with a single codebase, offering easier maintenance
and faster development, though sometimes at the cost of performance3.
8. Web-based Applications:
These are mobile-optimized websites accessed through a browser but designed to behave like
native apps. They do not require installation and are ideal for delivering content quickly and
universally across devices3.
9. Specialized Applications:
Some apps are tailored for specific domains, such as mapping and navigation (Google Maps,
Waze), travel booking ([Link], Airbnb), or smart home management. These apps provide
targeted solutions for particular user needs
Best Practices in Android Programming (10 Marks)
1. Follow Clean Architecture Principles
Design your app using a layered architecture (such as MVVM or Clean Architecture) to separate
concerns and improve code maintainability, scalability, and testability. Avoid placing business
logic in Activities or Fragments; instead, use ViewModels and repositories to manage data and
logic1.
2. Manage Lifecycle Effectively
Do not override lifecycle methods like onResume or onPause directly in Activities or Fragments.
Instead, use LifecycleObserver or the repeatOnLifecycle API to handle lifecycle events, ensuring
your app responds correctly to state changes and avoids memory leaks1.
3. Use Dependency Injection
Implement dependency injection (DI) to manage dependencies between components
efficiently. Prefer constructor injection and use frameworks like Hilt or Dagger for scalable and
testable code, especially in complex projects1.
4. Prioritize App Usability and User Experience
Focus on intuitive navigation, visual clarity, and responsive interfaces. Conduct usability testing
to ensure users can efficiently achieve their goals, which leads to higher satisfaction and app
success56.
5. Optimize Performance and Efficiency
Optimize your code and resources to ensure fast loading times and smooth operation. Minimize
resource usage, avoid unnecessary background processes, and use efficient data structures and
algorithms6.
6. Implement Robust Security Measures
Protect user data by using secure authentication, encryption, and following best security
practices. Always validate user input and handle sensitive information with care to prevent
unauthorized access or data breaches26.
7. Test Thoroughly and Continuously
Perform comprehensive testing, including unit, integration, and user acceptance tests. Prefer
using fakes over mocks, and test StateFlows and other reactive components to ensure reliability
and correctness16.
8. Choose the Right Tools and Technologies
Adopt modern languages like Kotlin for concise and safe code. Use Jetpack libraries (Room,
LiveData, ViewModel), Coroutines for asynchronous programming, and select tools that fit your
project’s requirements for better productivity and maintainability45.
9. Design for Scalability and Flexibility
Build your app with modular components so it can easily adapt to new features or changes in
business needs. This ensures long-term relevance and easier integration with other systems6.
10. Focus on User-Centered Design
Conduct user research and design your app for simplicity, consistency, and accessibility. Ensure
your app works well across various screen sizes and devices, providing a seamless experience
for all users
Android Tools
1. Android Studio
Android Studio is the official Integrated Development Environment (IDE) for Android app
development, created and maintained by Google. It provides powerful code editing, debugging,
and testing features within a user-friendly interface. Key features include a flexible Gradle-based
build system, an advanced code editor, visual layout editor, real-time profilers, and seamless
integration with emulators and device testing3678.
2. Android SDK (Software Development Kit)
The Android SDK is a collection of libraries, tools, and APIs essential for building Android
applications. It includes core development tools like compilers, debuggers, and utilities for
managing app resources and device compatibility. The SDK is integrated with Android Studio
and is required for all Android app projects34.
3. Android Debug Bridge (adb)
adb is a versatile command-line tool that enables communication between a developer’s
machine and an Android device or emulator. It is used for installing and debugging apps,
accessing device logs, running shell commands, and managing devices during development and
testing4678.
4. Android Virtual Device (AVD) Manager & Emulator
The AVD Manager allows developers to create and manage virtual devices that simulate various
Android hardware profiles and OS versions. The Emulator lets you test applications on these
virtual devices, ensuring compatibility across different screen sizes, resolutions, and Android
versions without needing physical devices34678.
5. IntelliJ IDEA
IntelliJ IDEA is a powerful IDE that serves as the foundation for Android Studio. It offers
advanced code completion, static analysis, refactoring, and project management features.
IntelliJ supports multiple languages and frameworks, making it a versatile tool for Android and
JVM-based development38.
6. Eclipse
Before Android Studio, Eclipse was the primary IDE for Android development. It is still used by
some developers for Java-based projects and supports a wide range of plugins for customizing
the development environment57.
7. ProGuard
ProGuard is a tool integrated into the Android build process that shrinks, optimizes, and
obfuscates code. It removes unused code and makes reverse engineering more difficult, helping
to protect intellectual property and reduce app size4.
8. SQLite3
SQLite3 is a lightweight database engine included in the Android SDK, used for local data
storage within apps. Developers use it to manage structured data efficiently and perform SQL
operations directly on the device4.
9. Gradle
Gradle is the build automation system used by Android Studio. It manages project
dependencies, compiles code, and packages APKs, enabling flexible and efficient build processes
for complex projects37.
10. Additional Tools
Other notable tools include Postman (for API testing), GitHub (for version control), and
Genymotion (a fast, feature-rich Android emulator used for advanced testing scenarios)
Building Your Android Application
Building an Android application involves several systematic phases, each crucial to delivering a
functional, user-friendly, and high-quality app. Below is a step-by-step outline of the process:
1. Set Up Your Development Environment
Begin by installing Android Studio, the official IDE for Android development. Set up the Android
SDK and configure your workspace to ensure you have the necessary tools and libraries for app
creation56.
2. Define Requirements and Plan
Clearly outline the app’s purpose, features, and target audience. Create a software
requirements specification (SRS) document that details both functional (what the app does) and
non-functional (how the app performs) requirements. This blueprint guides the entire
development process32.
3. Design the User Interface (UI) and User Experience (UX)
Use Android Studio’s layout editor to design intuitive and visually appealing screens. Focus on
usability, navigation, and responsiveness to different device sizes. Material Design guidelines
help ensure a consistent and modern look6.
4. Develop the Application
• Front-end Development: Write code for the user interface and client-side logic using
Java or Kotlin.
• Back-end Development: Implement server-side components, databases, and APIs if your
app requires data storage or remote processing. Connect the front end to the back end
using APIs23.
• Modularize your code for maintainability and scalability.
5. Build and Run the Application
Compile your code into an APK or App Bundle. Use Android Studio’s build tools and Gradle to
manage dependencies and create different build variants. Run your app on an emulator or a
physical device to check its basic functionality56.
6. Test and Debug
Thoroughly test your app for bugs, crashes, and performance issues. Use Android Studio’s built-
in tools like the debugger, Logcat, and profilers. Test on multiple devices and Android versions
using the AVD Manager to ensure compatibility and reliability56.
7. Optimize Performance and Polish
Profile your app to optimize memory usage, battery consumption, and load times. Refine the UI
and UX based on testing feedback, ensuring smooth navigation and responsiveness.
8. Prepare for Deployment
Sign your app with a secure key, create a release build, and ensure it meets Google Play’s
guidelines. Prepare promotional materials such as app icons, screenshots, and descriptions.
9. Publish and Monitor
Upload your app to the Google Play Store or other distribution platforms. After release, monitor
its performance, gather user feedback, and provide updates for bug fixes and new features
Anatomy of an Android Application
An Android application is composed of multiple layers and components that work together to
deliver robust, scalable, and user-friendly mobile experiences. Understanding the anatomy of an
Android app involves exploring its core components, architectural layers, and the role each plays
in the overall functioning of the application.
1. Core Application Components
Every Android app is built using four primary components, each serving a specific purpose in the
app’s operation:
• Activities: Represent individual screens with which users interact. Each activity is a
single, focused thing that the user can do, such as viewing a list or entering data.
• Services: Run in the background to perform long-running operations without a user
interface, such as playing music or fetching data from the internet.
• Broadcast Receivers: Respond to system-wide broadcast announcements, such as
battery low warnings or incoming SMS messages.
• Content Providers: Manage and share app data with other applications securely, such as
contacts or media files16.
These components are declared in the app’s manifest file, which the Android OS uses to
integrate the app into the device’s overall user experience1.
2. Android Application Architecture Layers
The Android application architecture is organized into several layers, each with distinct
responsibilities:
• Linux Kernel:
Forms the foundation of the Android OS, handling core functions like memory
management, process management, and hardware drivers. It acts as an abstraction layer
between device hardware and the rest of the software stack56.
• Native Libraries:
Libraries written in C/C++ that provide essential services such as graphics rendering
(OpenGL), database management (SQLite), and media playback.
• Android Runtime (ART):
Executes app code and provides a managed runtime environment. It includes core
libraries that enable Java-based development and efficient memory management56.
• Application Framework:
Offers high-level services and APIs for app development, such as resource management,
activity management, window management, and notification services. It enables
developers to build feature-rich and consistent apps across devices5.
• Applications:
The top layer consists of pre-installed system apps (like dialer, SMS, contacts) and user-
installed apps. These run within the Android runtime and interact with the framework
and libraries below56.
3. Android Architecture Components (Jetpack)
Modern Android development leverages Jetpack’s architecture components, which are libraries
designed to help developers build robust, maintainable, and testable apps. Key components
include:
• ViewModel: Manages UI-related data in a lifecycle-conscious way.
• LiveData: Enables UI components to observe data changes.
• Room: Simplifies database management and data persistence.
• Navigation: Handles in-app navigation and back stack management.
• WorkManager: Manages background tasks reliably23.
4. Key Design Principles
• Separation of Concerns:
The architecture promotes separating UI, business logic, and data layers, making the app
easier to maintain and test3.
• Lifecycle Awareness:
Components are designed to handle lifecycle events gracefully, preventing memory leaks
and ensuring data persistence during configuration changes
Android Terminologies
Understanding key Android terminologies is essential for anyone involved in Android app
development. Here are some of the most important terms with explanations:
1. Activity
An Activity is a single screen with a user interface in an Android app. Each activity represents a
distinct operation or page, such as a login screen or a settings page. Activities are fundamental
building blocks of Android applications and manage user interactions16.
2. Intent
An Intent is a messaging object used to request an action from another app component. Intents
facilitate communication between different components, such as starting a new activity, sending
data, or invoking system services like sharing content16.
3. Android SDK (Software Development Kit)
The Android SDK is a set of development tools and libraries provided by Google for building,
testing, and debugging Android applications. It includes essential components like compilers,
emulators, and platform tools5.
4. AVD (Android Virtual Device) / Emulator
An AVD is a configuration that allows developers to run and test Android applications on a
virtual device that simulates the hardware and software features of real Android devices5.
5. APK (Android Package Kit)
APK is the file format used by Android to distribute and install apps. It is similar to an executable
file in Windows (.exe) and contains all the components needed for an app to run on an Android
device6.
6. Gradle
Gradle is the build automation tool used in Android Studio to compile code, manage
dependencies, and package Android apps. It streamlines the build process and supports custom
build configurations5.
7. Java/Kotlin
Java and Kotlin are the primary programming languages for Android development. Java has
been the traditional language, while Kotlin is now the preferred modern language due to its
concise syntax and full interoperability with Java6.
8. Density-independent Pixel (dp) and Scalable Pixel (sp)
dp is a unit of measurement for UI elements that ensures consistent sizing across devices with
different screen densities. sp is similar but used for font sizes, adjusting for both screen density
and user font preferences1.
9. Content Provider
A Content Provider manages access to structured data and allows data sharing between
different apps securely, such as sharing contacts or media files1.
10. Android Jetpack
Android Jetpack is a suite of libraries and tools that help developers follow best practices,
reduce boilerplate code, and build robust Android apps more efficiently
Android Manifest file and its Common Settings
The Android Manifest file ([Link]) is a fundamental part of every Android
application. It acts as a blueprint that provides essential information about the app to the
Android operating system, build tools, and Google Play25. This file is always located at the root
of the app’s project directory and is written in XML format56.
Purpose of the Android Manifest File
The manifest file serves several critical functions:
• App Identification: It uniquely identifies the app with a package name and version
information, which the system uses to manage and update the app46.
• Declaring Components: All app components-activities (UI
screens), services (background tasks), broadcast receivers (system event handlers),
and content providers (data sharing)-must be declared here for the system to recognize
and use them457.
• Permissions: The manifest specifies permissions that the app needs, such as internet
access or reading contacts, using <uses-permission> tags45.
• Intent Filters: It defines how components respond to intents, enabling inter-component
and inter-app communication47.
• App Configuration: It sets app-wide configurations, such as supported screen sizes,
orientations, minimum SDK version, and hardware features15.
• App Metadata: The manifest also defines the app’s icon, label, themes, and other
metadata58.
Common Settings and Elements in the Manifest File
• <manifest>: The root tag, containing the package name and version attributes35.
• <application>: Declares app-level settings and contains all the app’s components.
Common attributes include android:icon, android:label, and android:theme56.
• <activity>: Declares an activity (screen), often with an <intent-filter> to mark the main
entry point of the app
• <service>: Declares background services
• <receiver>: Declares broadcast receivers for handling system-wide events
• <provider>: Declares content providers for sharing data between apps
• <uses-permission>: Requests permissions needed by the app
• <uses-sdk>: Specifies the minimum and target SDK versions
• <uses-feature>: Declares required hardware or software features
• <meta-data>: Allows inclusion of additional metadata for use by the app or system