Detailed Notes - Unit 1: Introduction to
Android
1. Introduction to Android
Android is an open-source operating system developed by Google for mobile devices such as
smartphones and tablets. It is based on the Linux kernel and provides a rich application
framework that allows developers to build innovative apps and games.
Key features include open-source nature, multitasking, customizable UI, multi-language support,
and strong developer tools. Android versions are named alphabetically after sweets like
Cupcake, Donut, Eclair, and so on up to Android 14.
2. History of Mobile Software Development
Mobile software development began with simple feature phones that could only run pre-
installed applications. As technology advanced, smartphones emerged with operating systems
like Symbian and Windows Mobile.
The release of iOS and Android revolutionized the mobile industry by providing powerful
platforms for app development. App stores became central, allowing third-party developers to
publish applications.
3. The Open Handset Alliance (OHA)
The OHA is a consortium of companies led by Google to promote open standards in the mobile
industry. It includes hardware manufacturers, software developers, and mobile operators.
The goal of the OHA is to accelerate innovation and make mobile devices more open and user-
friendly through Android.
4. The Android Platform
Android’s architecture has four layers:
- Linux Kernel: Hardware abstraction and security.
- Libraries and Android Runtime (ART): Core libraries and runtime environment.
- Application Framework: High-level services like activity manager and content provider.
- Applications: User-facing apps written by developers.
Components include Activities, Services, Broadcast Receivers, and Content Providers.
5. Android SDK (Software Development Kit)
The Android SDK includes a set of tools and APIs necessary for developing Android applications.
It comes with Android Studio, emulator, platform tools, build tools, and API libraries.
Developers use it to write, test, and debug Android apps efficiently.
6. Building a Sample Android Application
Steps to create an Android app:
1. Create a new project in Android Studio.
2. Design the user interface using XML files.
3. Write application logic in Java or Kotlin.
4. Compile and run the app on an emulator or physical device.
Example: A Hello World app displays a text message on screen when opened.
7. Anatomy of Android Applications
An Android application consists of:
- Components: Activities, Services, Broadcast Receivers, and Content Providers.
- Supporting files: Manifest file, resources (like XML layouts, images), and native libraries.
The main entry point is defined in the AndroidManifest.xml file.
8. Android Terminologies
- APK: Android Package file used to distribute and install apps.
- AVD: Android Virtual Device used for testing.
- Gradle: Build system for managing dependencies and compiling.
- API: A set of programming instructions and standards.
- SDK: Toolkit for development.
9. Core Android Components
- Application Context: Provides app-wide information and access.
- Activity: Represents a single screen with a UI.
- Service: Runs in the background without UI.
- Intent: Messaging object used to request an action from another app component.
10. Receiving and Broadcasting Intents
- Implicit Intents: Launch apps or components not directly named (e.g., open camera).
- Explicit Intents: Start a specific component by name.
- Broadcast Receivers: Handle system-wide events like battery changes or network availability.
11. Android Manifest File
This is an essential configuration file declaring all components, permissions, app metadata, and
more.
Examples:
- <activity>: Declares an activity.
- <service>: Declares a service.
- <uses-permission>: Declares required permissions like INTERNET or CAMERA.
12. Using Intent Filters
Intent filters declare an app’s ability to respond to certain actions. They are defined in the
manifest and specify actions, categories, and data types that an app can handle.
This allows other apps or system services to invoke the app.
13. Permissions
Permissions are required to access restricted parts of the device like the camera, contacts, or
network.
Declared in the AndroidManifest.xml and requested at runtime for dangerous permissions (post
Android 6.0).
14. Managing Application Resources
Android apps manage resources (images, layouts, strings) in the 'res' directory. Resources are
grouped in subfolders such as drawable, layout, values, etc.
They help manage localization, themes, and screen density compatibility.
15. Working with Different Types of Resources
Resources are accessed via the 'R' class. For example:
- R.layout.main_activity: References a layout file.
- R.string.app_name: References a string.
Resources can be accessed programmatically using getResources() or ContextCompat utilities.