Android is an open-source mobile operating system (OS) developed by Google.
It powers a
wide range of devices, including smartphones, tablets, smart TVs, smartwatches, and even cars.
Key Features of Android
1. Open Source
Android is built on the Linux kernel and is free for manufacturers to use and modify. This is
why many companies—Samsung, Xiaomi, Oppo, etc.—use Android.
2. Customizable
Users and manufacturers can customize:
• Home screens
• Widgets
• Themes
• System settings
3. Google Ecosystem Integration
Android is tightly connected with Google services:
• Google Play Store
• Gmail
• Maps
• Google Assistant
4. Vast App Ecosystem
Android apps are built using Java, Kotlin, and sometimes C++. They are distributed through the
Google Play Store and other app stores.
Android Architecture (Basic Layers)
1. Linux Kernel
Handles security, drivers, and hardware communication.
2. Hardware Abstraction Layer (HAL)
Connects hardware like cameras, sensors, and GPS to software.
3. Android Runtime (ART)
Runs Android applications.
4. Native Libraries
Libraries for graphics, media, and databases (e.g., SQLite).
5. Application Framework
Provides tools developers use to build apps (e.g., Activities, Services).
6. Applications
The apps we use daily—Phone, Messages, WhatsApp, etc.
Android App Development Basics
Languages Used:
• Java
• Kotlin → Google’s recommended language
• XML (for layouts)
Tools:
• Android Studio (official IDE)
• Android SDK (Software Development Kit)
🧠 Anatomy of an Android Application
An Android app is made up of several core components. These components work together to
create screens, handle user interaction, store data, and manage background work.
Below are the four main components + other essential elements.
🔹 1. Activities
An Activity represents a single screen in an app.
Examples:
• Login screen
• Settings screen
• Home screen
Each activity has:
• Java/Kotlin file → logic
• XML layout → UI
Example: [Link], activity_main.xml
🔹 2. Fragments
A Fragment is a sub-section of a screen.
It can be reused inside multiple activities.
Examples:
• A “list” fragment in a news app
• A “map” fragment inside a location screen
Fragments help with:
• Reusable UIs
• Tablet and phone layouts
🔹 3. Services
A Service runs in the background, even when the app is not visible.
Used for:
• Playing music
• Downloading files
• Performing background tasks
A service has no UI.
🔹 4. Broadcast Receivers
Broadcast receivers let apps respond to system-wide events.
Examples:
• Battery low
• Network connected
• SMS received
• Phone restarted
They help the app "listen" to important events.
🔹 5. Content Providers
Content providers manage data access between apps.
Examples:
• Contacts app
• Media files
• Calendar events
They allow:
• Reading/writing shared data
• Secure data sharing between apps
🧰 Other Essential Parts of an Android App
✔ 6. Intents
✔ 7. Manifest File ([Link])
✔ 8. Resources
✔ 9. Gradle Build System
🌟 What is Eclipse?
Eclipse is a free and open-source Integrated Development Environment (IDE) used mainly
for writing, testing, and debugging software.
It is built in Java, and is one of the oldest and most popular IDEs for Java development.
Before Android Studio existed, Eclipse was the official IDE for Android app development
(using the ADT plugin).
🧰 Key Features of Eclipse
✔ 1. Multi-language support
Although built for Java, Eclipse supports:
• Java
• C / C++
• Python
• PHP
• JavaScript
• Kotlin (with plugins)
and many more…
This is possible because Eclipse uses a plugin-based architecture.
✔ 2. Plugin-based system
Eclipse is highly customizable.
You can install plugins for:
• GUI builders
• Database tools
• Web development
• Android development (old ADT plugin)
• Version control (Git, SVN)
This makes Eclipse flexible and suitable for many types of projects.
✔ 3. Workspace & Project Organization
Eclipse uses:
• Workspace → main working directory
• Projects → individual applications or modules
You can manage multiple projects in one workspace.
✔ 4. Built-in Tools
Eclipse provides:
• Code editor
• Debugger
• Compiler
• Project explorer
• Syntax highlighting
• Auto-completion
• Error detection
These tools help developers write code faster and more accurately.
A Fragment is a reusable piece of a user interface (UI) that you can place inside an Activity.
Think of an Activity as a full screen, and a Fragment as a section or part of that screen.
Fragments help you create flexible and reusable layouts.
🧩 Why Do We Use Fragments?
Fragments are useful because they allow:
✔ 1. Reusable UI
You can use the same fragment in multiple activities.
✔ 2. Adaptive layouts
For small screens like phones → one fragment at a time
For tablets → two fragments side-by-side
Example:
Email app on a tablet (List on left, Content on right)
✔ 3. Better modular design
Each fragment handles its own UI and logic, making apps easier to manage.
📁 Structure of a Fragment
Each fragment has:
✔ A Kotlin/Java file
Example: [Link]
✔ An XML layout file
Example: fragment_home.xml
📌 Definition: Displaying Notifications in Android
Displaying notifications in Android refers to the process of showing alert messages to the user
in the device's status bar and notification panel.
These notifications inform users about important events such as messages, reminders, updates, or
background activities.
A notification usually includes:
• A small icon
• A title
• A message
• Optional actions (buttons)
• Optional sound/vibration
✅ 1. Status Bar Notifications
These are the regular notifications that appear at the top of the screen in the status bar, and can
be viewed by pulling down the notification drawer.
Includes:
• Title
• Message
• Small icon
• Optional actions
➡ Example: WhatsApp message, Gmail email alert.
✅ 2. Heads-Up Notifications
These are high-priority notifications that pop up on the screen temporarily (floating banner)
while the user is using the phone.
Used for urgent alerts:
• Incoming calls
• Alarms
• Emergency messages
• High-priority chat messages
➡ They appear over the current screen for a few seconds.
✅ 3. Lock Screen Notifications
These notifications appear when the phone is locked.
They can appear in three modes:
• Public → shows full content
• Private → hides sensitive details
• Secret → shows nothing
➡ Example: Showing message previews or alerts on the lock screen.
📱 Components of a Screen in Android
An Android screen (Activity or Fragment) is made up of various UI components placed inside a
layout. These components are also called Views and ViewGroups.
🔹 1. View (UI Element)
A View is a basic UI component that the user can see and interact with.
Examples of Views:
• TextView (displays text)
• Button
• ImageView
• EditText (input field)
• CheckBox
• RadioButton
• ProgressBar
🔹 2. ViewGroup (Container/Layout)
A ViewGroup is a container that holds multiple Views or other ViewGroups.
It defines how UI elements are arranged on the screen.
Common ViewGroups:
• LinearLayout (arranges items vertically or horizontally)
• RelativeLayout / ConstraintLayout (positions items based on rules)
• FrameLayout
• ScrollView
• RecyclerView
🔹 3. Layout File (XML)
Every screen has an XML file that defines:
• UI structure
• Position of components
• Colors, sizes, padding, margin
Example: activity_main.xml
🔹 4. Toolbar / App Bar
The top bar of a screen that displays:
• App title
• Navigation icons
• Menu options
🔹 5. Status Bar
The topmost system bar showing:
• Time
• Battery level
• Network status
(Not controlled by the app, but part of screen appearance.)
🔹 6. Navigation Bar
Bottom buttons for system navigation:
• Back
• Home
• Recent apps
(Some phones use gestures instead.)
🔹 7. Floating Action Button (FAB)
A round button used for a main action.
Example:
The "+" button in Gmail to compose email.