Mad Solved QB
Mad Solved QB
2 Marks Questions
Open-source
○
○ Supports multiple languages
○ High security
○ Multi-tasking
○ Customizable UI
○ Supports various sensors
2. What is OHA?
○ ndroid Studio
A
○ SDK (Software Development Kit)
○ AVD (Android Virtual Device)
○ Emulator
○ Gradle
4 Marks Questions
he Android ecosystem includes all the components required for Android apps to
T
function.
ndroid provides a powerful, flexible, and open-source platform for users and
A
developers.
. L
1 inux Kernel– Manages hardware (CPU, memory, drivers)and handles security.
2. Native Libraries– Supports databases (SQLite), graphics(O
penGL), and multimedia
(Media Framework).
3. Android Runtime (ART/DVM)– Runs apps efficientlyby converting Java code into
bytecode.
4. Application Framework– Manages app features likeActivities, Notifications, and GPS.
5. Applications– User apps (WhatsApp, YouTube) and systemapps (Phone, Messages).
2 Marks Questions
ndroid SDK (Software Development Kit)is a set of tools used to create Android
A
apps. It provides everything needed to develop, test, and run Android applications.
● L ibraries– Ready-made code to help with app development (UI, database,
graphics).
● Emulator– A virtual Android phone to test apps without a real device.
● Debugger– Helps find and fix errors in the app.
● Build Tools– Used to compile and package apps into APK files.
● API (Application Programming Interface)– Allows apps to communicate with
Android features like camera, GPS, and notifications.
H
● elps developers create Android apps easily.
● Provides tools to test and debug applications.
● Ensures apps work on different Android versions and devices.
O
○ n the first launch, it will ask to download SDK and necessary tools.
○ Click"Next"and wait for installation to finish.
Chapter 3: UI Components and Layouts
2 Marks Questions
a
● ndroid:layout_width –Sets the width (
match_parent wrap_content
, ).
● android:layout_height –Sets the height of the layout.
● android:stretchColumns –Stretches specific columns to fit the screen (e.g.,
"1,2"
).
● android:shrinkColumns –Shrinks specific columns if needed.
● android:collapseColumns –Hides specific columns.
● android:background –Sets background color or image.
● android:padding –Adds space inside the layout.
4 Marks Questions
Main Uses:
A
● pp Name & Icon– Sets the app’s name and launcher icon.
● Declare Activities & Services– Defines the main screen (
activity
) and
ackground tasks (
b service ).
● Request Permissions– Allows the app to use features like:
○ Internet→ For online access.
○ Camera→ For taking pictures.
Set Minimum Android Version– Ensures the app runs on supported Android
●
versions.
● Declare Hardware Features– Tells if the app needs GPS, Bluetooth, etc.
3. What are view and viewgroup classes in android? Why layouts are
created using xml file?
A
● Viewis a single UI element likeButton, TextView,ImageView.
● It displays content and allows user interaction.
A
● ViewGroupis a container that holds multipleViews.
● Examples:
○ LinearLayout– Arranges views in a row/column.
○ RelativeLayout– Positions views relative to each other.
○ ConstraintLayout– Allows complex layouts.
Why Use XML for Layouts?
.
1 eparates Design & Logic– UI in XML, functionality in Java/Kotlin.
S
2. Easy to Modify– XML is structured and simple to update.
3. Reusable Layouts– Same XML can be used for multiple screens.
4. Faster Development– Supportsdrag-and-dropdesigningin Android Studio.
5. Better Performance– Optimized for smooth app functioning.
. d
1 rawable/– Stores images and icons.
2. layout/– Contains XML files for designing app screens.
3. values/– Stores text, colors, and sizes.
○ strings.xml– Holds text like app name and buttonlabels.
○ colors.xml– Defines app colors.
○ dimens.xml– Stores sizes like margins and padding.
4. mipmap/– Holds app icons in different sizes.
5. raw/– Stores audio or video files.
6. anim/– Contains animation effects
Chapter 4: Designing UI with Views
2 Marks Questions
○ utton
B
○ TextView
○ EditText, ImageView
○ ListView
○ RecyclerView\
1. wrap_content
● he view takes only the space needed for its content.
T
● Example:A button adjusts its size to fit the text.
● Used for small elements like buttons and labels.
● Saves space by not making the view bigger than needed.
2. match_parent
● he view expands to fill the entire parent container.
T
● Example:A TextView stretches to match the full width.
● Used for large elements like full-width banners or background images.
● Ensures consistent design by making the view match the parent size.
4 Marks Questions
extView is a UI component in Android that is used to display text on the screen. It is read-only,
T
meaning users cannot type or edit the text. It is commonly used to show labels, titles, or
instructions in an app.
ditText is a UI component that allows users to enter and edit text. It is mostly used for input
E
fields, such as entering a name, email, password, or comments.
TextView Attributes
● ext –Defines the text displayed in the TextView.
T
● Text Size –Controls the size of the text.
● Text Color –Changes the color of the text.
● Gravity –Aligns the text inside the TextView (left, right, center, etc.).
● Text Style –Makes the text bold, italic, or normal.
● Max Lines –Limits the number of lines shown in the TextView.
● Ellipsize –If the text is too long, it shows "..." at the end.
● Background –Sets a background color or image for the TextView.