0% found this document useful (0 votes)
7 views6 pages

What Is Android?

Android is an open-source, Linux-based operating system designed for touchscreen devices, developed by the Open Handset Alliance led by Google. It features a customizable interface, supports a variety of applications, and has a structured architecture consisting of five key layers. The development lifecycle includes managing user interactions through activities, while the application components encompass activities, services, broadcast receivers, and content providers.

Uploaded by

suhanijiit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views6 pages

What Is Android?

Android is an open-source, Linux-based operating system designed for touchscreen devices, developed by the Open Handset Alliance led by Google. It features a customizable interface, supports a variety of applications, and has a structured architecture consisting of five key layers. The development lifecycle includes managing user interactions through activities, while the application components encompass activities, services, broadcast receivers, and content providers.

Uploaded by

suhanijiit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

1. What is Android?

Android is an open-source, Linux-based operating system mainly designed for touchscreen mobile
devices like smartphones and tablets. It was developed by the Open Handset Alliance, which is led
by Google. Android allows developers to build applications that run on a wide variety of devices
using the same code base.

Key Features:

• Open-source: Free to use and modify by developers or device manufacturers.

• Customizable: Manufacturers can customize the interface and features.

• App Variety: Huge range of apps available on the Play Store.

• Supports various functionalities: Messaging, internet browsing, media playback, device


connectivity (Bluetooth, Wi-Fi), and storage.

• Multitasking: Multiple applications can run simultaneously.

• Google Services: Deep integration with Google tools like Gmail, Maps, YouTube.

• Device Flexibility: Can work as a router, install custom ROMs, support 2D/3D graphics,
and runs on TVs, tablets, and set-top boxes too.

2. Android Architecture

The Android system is organized into ve key layers:

1. Linux Kernel

◦ Acts as the foundation.

◦ Manages core services like memory, device drivers, and power.

2. Native Libraries

◦ Built using C/C++.

◦ Examples:

▪ WebKit: Web browser engine

▪ SQLite: Lightweight database

▪ FreeType: Font rendering

▪ Media Libraries: Audio/video playback

3. Android Runtime (ART/Dalvik VM)

◦ Dalvik (older) or ART (newer) executes Android applications.


fi
◦ Designed to be memory ef cient and suitable for mobile devices.

4. Application Framework

◦ Provides APIs to app developers.

◦ Includes services like Activity Manager, Resource Manager, and Noti cation
Manager.

5. Applications

◦ Top layer used by end users.

◦ Built-in apps (Contacts, Camera) and third-party apps.

3. Android Development Lifecycle

An Activity is a single screen that the user interacts with. It resembles a window in desktop
applications.

Lifecycle Methods:

• onCreate(): Called when the activity is rst created. UI setup happens here.

• onStart(): Activity becomes visible.

• onResume(): User can interact with the activity.

• onPause(): Called when the activity loses focus (e.g., a popup appears).

• onStop(): Activity is no longer visible.

• onRestart(): Called before the activity is resumed.

• onDestroy(): Final cleanup before activity is destroyed.

XML Layout Example:

<LinearLayout android:orientation="vertical">

<TextView android:text="Welcome!" />

<Button android:text="Click Me" />

</LinearLayout>

4. User Interface and Layout

• View: Basic UI component (e.g., TextView, Button).

• ViewGroup: Container for Views (e.g., LinearLayout).

• Layouts: De ne how Views are arranged on the screen.


fi
fi
fi
fi
Common Layouts:

• LinearLayout: Arranges views in a row or column.

• RelativeLayout: Views are positioned relative to each other.

• Table Layout: TableLayout is a view that groups views into rows and columns.

• Absolute Layout: AbsoluteLayout enables you to specify the exact location of its children.

• Frame Layout :The FrameLayout is a placeholder on screen that you can use to display a
single view.

• List View : ListView is a view group that displays a list of scrollable items.

• Grid View : GridView is a ViewGroup that displays items in a two-dimensional, scrollable


grid.

Layout Attributes
• android:id : This is the ID which uniquely identi es the view.

• android:layout_width : This is the width of the layout.

• android:layout_height : This is the height of the layout

• android:layout_marginTop : This is the extra space on the top side of the layout.

• android:layout_marginBottom : This is the extra space on the bottom side of the layout.

• android:layout_marginLeft : This is the extra space on the left side of the layout.

• android:layout_marginRight : This is the extra space on the right side of the layout.

• android:layout_gravity : This speci es how child Views are positioned.

• android:layout_weight : This speci es how much of the extra space in the layout should be
allocated

• to the View.

• android:layout_x : This speci es the x-coordinate of the layout.

• android:layout_y : This speci es the y-coordinate of the layout.

• android:layout_width : This is the width of the layout.

• android:paddingLeft : This is the left padding lled for the layout.

• android:paddingRight : This is the right padding lled for the layout.

• android:paddingTop : This is the top padding lled for the layout.

• android:paddingBottom : This is the bottom padding lled for the layout.


fi
fi
fi
fi
fi
fi
fi
fi
fi
Units:

• dp: Device-independent pixels

• sp: Scalable pixels (used for text)

5. Controllers

Controllers handle user inputs, process them, and update the UI or data accordingly.

• Part of MVC (Model-View-Controller) or MVVM (Model-View-ViewModel).

Role in Android:

• Activity or Fragment usually acts as the Controller.

• Handles events like button clicks, validates input, and updates UI.

In a typical MVC architecture in Android:

Model: Handles the data (e.g., Room database, API calls).

View: The UI (e.g., XML layouts, Activity/Fragment UI components).

Controller: Handles user actions, processes input, and updates the model or the view
accordingly.

1. Role of Controller

The controller is the "decision maker" in the app.

It manages user interactions and updates both the view and model.

In Android, the Activity or Fragment often serves this role.

It reacts to UI events (clicks, gestures) and communicates with business logic.


Ques Why Use Controller

Keeps code organized and maintainable.

Separates concerns: UI code, data logic, and input handling are split.

Helps in testing logic without UI.

Makes scaling the app easier (e.g., adding new features or views)

6. Application Components

Android applications are built using these 4 key components:

1. Activities: Screens with UI; interact with the user.

2. Services: Perform background tasks without UI.

3. Broadcast Receivers: Respond to system-wide or app-speci c events.

4. Content Providers: Share data between applications.

All components are registered in the AndroidManifest.xml le.

Additional Components
Fragments : Represents a portion of user interface in an Activity.

Views : UI elements that are drawn on-screen including buttons, lists


forms etc.

Layouts :View hierarchies that control screen format and appearance


of the views.

Intents :Messages wiring components together.

Resources :External elements, such as strings, constants and drawable


pictures.

Manifest :Con guration le for the application.

7. Directives

Used to give additional instructions in code or XML.

In XML Layouts:

<TextView tools:text="Design-time Text" />


8. Services & Views

• Service: A component for long-running tasks (e.g., music, le download).

• Types of Services:
fi
fi
fi
fi
fi
◦ Foreground: With visible noti cation

◦ Background: Without user visibility (can be killed)

◦ Bound: Bound to an Activity/Fragment

• Views: UI elements like buttons and text elds.

◦ Should be designed for different orientations.

◦ Fragments help modularize UI for better exibility.

9. R.java File

• Auto-generated le that links XML to Java.

• Contains IDs for views, strings, layouts.

Button myButton = findViewById(R.id.my_button);

10. strings.xml

• Used to store text separately from layout les.

• Makes localization easier.

<resources>
<string name="hello_world">Hello World!</string>
</resources>

11. Categories of Android Applications

• Entertainment: Games, streaming

• Communication: Messaging, email

• Tools: Calculators, le managers

• Productivity: Calendars, to-do lists

• Personalization: Wallpapers, themes

• Music and Audio: Music players

• Travel and Local: Maps, transport apps


fi
fi
fi
fi
fi
fl

You might also like