TY MAD Assignment No 5 & 6

TY MAD Assignment No 5 & 6

Q1. What is a GUI component in Android?

Answer:
GUI (Graphical User Interface) components are the visible elements of an Android app that users can see and interact with.
They make the app easy to use and visually appealing.
These components help users perform actions like clicking, typing, and selecting options.
Common examples include buttons, text fields, images, and lists.


Q2. What is TextView and EditText?

Answer:

  • TextView: It is used to display text on the screen. It shows information such as headings, labels, or instructions to the user.

  • EditText: It is used to take input from the user. Users can type and edit text in this field.
    For example, it is used for entering name, email, password, or any data.
    EditText can also be customized for different input types like numbers or passwords.


Q3. What is a Button and its types?

Answer:
A button is a UI component that performs an action when the user clicks or taps on it.
It is used to trigger events like submitting a form or opening a new screen.
Types of buttons include:

  • Simple Button: A basic button with text

  • Image Button: A button that displays an image instead of text

  • Toggle Button: A button with two states (ON/OFF), used like a switch
    Buttons improve user interaction and control within the app.


Q4. What are Checkbox and RadioButton?

Answer:

  • Checkbox: It allows users to select multiple options at the same time. Each option works independently.
    Example: Selecting multiple interests or preferences.

  • RadioButton: It allows only one option to be selected at a time from a group.

  • RadioGroup: It is used to group RadioButtons together so only one option can be selected.
    These components are used in forms and selection-based inputs.


Q5. What is a ProgressBar and Scrollbar?

Answer:

  • ProgressBar: It is used to show the progress of a task such as loading data, downloading files, or processing.
    It helps users understand how much work is completed and how much is left.

  • Scrollbar: It allows users to scroll the screen when the content is too large to fit.
    It improves navigation in long pages or lists.


Q6. What is List and Custom Toast Message?

Answer:

  • List: It displays a collection of items in a vertical scrollable format.
    It is commonly used for showing contacts, products, or menu items.

  • Custom Toast Message: It is a small temporary message that appears on the screen.
    It provides feedback like “Login Successful” or “Data Saved”.
    It can be customized using different layouts, colors, and styles.


Q7. What is a Layout in Android?

Answer:
A layout is a container that holds and arranges UI components on the screen.
It controls the structure and position of elements like buttons, text, and images.
Layouts help in designing a clean and organized interface.
Different layouts are used depending on how we want to arrange the components.


Q8. What are different types of layouts?

Answer:
Android provides different types of layouts for arranging UI components:

  • Linear Layout: Places elements in a single row (horizontal) or column (vertical)

  • Constraint Layout: A flexible layout used to create complex and responsive designs

  • Frame Layout: Used to display a single view or stack views on top of each other

  • Relative Layout: Positions elements relative to other elements (above, below, beside)
    Choosing the right layout improves app design and performance.


Q9. What are Views and their types?

Answer:
Views are the basic building blocks of an Android user interface.
They represent all UI elements that users interact with.
Different types of views include:

  • ListView: Displays items in a vertical scrollable list

  • GridView: Displays items in rows and columns (grid format)

  • ImageView: Used to display images in the app

  • ScrollView: Allows scrolling when content exceeds screen size
    Views are always placed inside layouts.


Q10. What is Splash Screen and how to style it?

Answer:
A splash screen is the first screen displayed when the app is launched.
It usually shows the app logo, name, or branding for a few seconds.
It gives users a first impression of the app.
We can style it using colors, background images, app logo, and themes.
Good styling makes the app look professional and improves user experience.



Popular posts from this blog