“Mobile Application & Development: Introduction to Android”
Android: A mobile opera�ng system based on the Linux kernel, designed specifically for touch screen
devices like smartphones and tablets. Unlike Linux, Android has been heavily modified for mobile
environments. It provides a rich applica�on framework that allows you to build innova�ve apps and
games for mobile users.
Example: Android OS manages your phone's basic func�ons like resource alloca�on to apps, handling
calls, and managing data received via the network.
Origin of Android
• Founda�on and Acquisi�on: Android Inc. was founded by Andy Rubin in October 2003 and was
later acquired by Google in August 2005. The ini�al vision for Android was for it to power smart
cameras, but it was quickly pivoted to smartphones as the market for a camera-only device was
limited.
• First Android Phone: The HTC Dream, released in 2008, was the first commercially available
smartphone to run the Android opera�ng system.
Features of Android
• Intui�ve UI: Android offers a user-friendly interface that is intui�ve and interac�ve, u�lizing
concepts like direct manipula�on with touch inputs.
• Storage with SQLite: For data storage, Android uses SQLite, a lightweight rela�onal database,
allowing for a robust data storage solu�on.
• Mul�-tasking: Android supports simultaneous running of applica�ons, making it efficient for
users to switch between tasks or use mul�ple applica�ons at once.
Example: Users can listen to music while browsing the internet or check emails without closing their
naviga�on app.
Android Limita�ons
• Performance and Security Concerns: Some users might experience issues with performance,
such as overhea�ng and lag due to background app processes. Security and privacy can also be a
concern with varying levels of app quality and safety in the Google Play Store.
Anatomy of an Android Applica�on
• Ac�vity: It's like a single page of a book, represen�ng a screen with a user interface. For
instance, an email app might have one ac�vity showing a list of new emails, another ac�vity to
compose emails, and another for reading emails.
• View and ViewGroup: The fundamental UI components; View is a basic building block (like a
buton or text field), and ViewGroup is a container that holds other Views (like a layout).
• Intent: A messaging object you can use to request an ac�on from another app component. For
example, to start a new ac�vity, you send an Intent to the Android system defining the new
ac�vity to start.
• Service: Runs in the background to perform work for remote processes or long-running
opera�ons, like playing music even when the user is not interac�ng with the app.
• Content Provider: Manages a shared set of app data. Through this, data stored in one app can
be securely shared with another app.
UI Design
• XML in UI Design: XML is used in Android for layout design. It's easy to read and allows for
precise control over the UI elements and layout without affec�ng the app's performance.
Example: Defining a simple user interface with XML for an Android applica�on might include a TextView
for displaying text and a Buton for user interac�on.
Development Environment
• Android Studio: The official integrated development environment (IDE) for Android applica�on
development, providing tools for coding, debugging, and tes�ng Android apps efficiently.
Layout in Android Development
• Defini�on: A layout in Android defines the visual structure for a user interface by arranging
views (UI components like butons and text fields) and view groups (containers for views) in a
hierarchical manner. Layouts are typically defined in XML, allowing for precise placement of
elements and adaptability to different screen sizes.
• Linear Layout: Arranges its children in a single column or a single row. The orienta�on can be
ver�cal or horizontal, making it straigh�orward to create simple UIs.
Example (Linear Layout)s:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button 1"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button 2"
android:layout_marginTop="16dp"/>
</LinearLayout>
This example shows a Linear Layout with ver�cal orienta�on containing two butons. It demonstrates
how the layout manages the placement and spacing of the butons within the user interface.