Font size
WorksheetsMobile UI Design Quiz
Total questions: 84
Worksheet time: 42mins
What is a key consideration when designing for adaptive UI, beyond just Dark Mode?
Ensuring all elements have fixed sizes
Using only a single font across the app
Responding to changes in device orientation, screen size, and system preferences
Limiting the number of screens in the application
Why responsive design is critical for mobile apps?
To reduce app size
To improve app monetization
To ensure usability across different devices and screen sizes
To make apps faster
What is the main benefit of implementing adaptive UI for users?
Faster app downloads
Reduced battery consumption
A more comfortable and intuitive experience across diverse contexts
Guaranteed bug-free performance
When adapting UI for different screen sizes, what Android XML layout component is best suited for complex and flat hierarchies?
LinearLayout
RelativeLayout
FrameLayout
ConstraintLayout
In Android, if you want to create a responsive UI that adjusts based on the width of a parent container (not the screen), which feature would you use?
Media Queries
wrap_content
Container Queries (supported via Jetpack Compose or webviews)
layout_weight
What SwiftUI feature can be used to provide alternative views or content for different size classes or environmental conditions?
ViewModifier
@State
@Binding
@Environment and Conditional Views
What is a common UI pattern for presenting a collection of images in a mobile application?
Single image view with forward/back buttons
Text-based list of image filenames
An image gallery or grid view
A slideshow without user control
What Android UI component is commonly used to display large lists of data, such as images in a gallery, efficiently?
ListView
ScrollView
GridView
RecyclerView
When developing an image gallery app, what is a crucial aspect of handling images from external sources (like the internet)?
Loading all images at once
Displaying low-resolution thumbnails
Efficient image loading, caching, and lazy loading
Storing all images in the app's internal storage
Interpret Auto Layout benefits in UI design for iOS.
Provides constraints for responsive UI
Allows fixed positioning only
Limits developers to predefined templates
Works only on iPads
What is the purpose of an Adapter in the context of Android's RecyclerView?
To store the actual image data
To manage network requests for images
To bridge the data source with the RecyclerView and provide views for each item
To handle touch events on the images
What SwiftUI view is ideal for displaying a grid of images in a gallery app?
HStack within a VStack
List
Form
LazyVGrid or LazyHGrid
To allow users to view images in full-screen and swipe between them in an image gallery app, which SwiftUI view could be used?
ForEach inside a ScrollView
HStack with TapGesture
TabView
Text with image links
Which Android UI component displays a single image?
TextView
Button
ListView
ImageView
What is the core component that represents a single screen with a user interface in Android?
Service
BroadcastReceiver
Activity
ContentProvider
Compare Flexbox in React Native with Auto Layout in SwiftUI.
Flexbox uses row/column alignment, Auto Layout uses constraints
Flexbox is only for images, Auto Layout is only for buttons
Both are font styling systems
Flexbox is for iOS, Auto Layout is for Android
Which UI component allows users to input text in Android?
Button
TextView
CheckBox
EditText
What is the primary function of a Button component in Android?
To display text
To show an image
To trigger an action when tapped
To store data
Which Android component is used to manage background tasks that do not require a UI?
Activity
ContentProvider
Service
BroadcastReceiver
What is the purpose of a Toast message in Android?
To display a persistent notification
To show a complex dialog
To provide brief feedback to the user, fading away after a short time
To launch a new activity
Which Android UI component is used to display a simple, non-editable block of text?
EditText
RadioButton
CheckBox
TextView
What is the role of an Intent in Android?
To define the app's theme
To handle user interface styling
To communicate between components (e.g., start an Activity)
To manage app permissions
The importance of typography scaling in mobile UI.
It reduces memory usage
It improves database performance
It ensures text is readable on different screen sizes
It makes layouts static
Which XML attribute is commonly used to set the text displayed on a Button or TextView in Android?
android:id
android:src
android:hint
android:text
What is RecyclerView in Android primarily optimized for?
Displaying a small, fixed number of items
Storing data offline
Managing network requests
Efficiently displaying large datasets in scrollable lists
What does ViewHolder do in a RecyclerView?
Stores the data for all items in the list
Handles user input for the entire list
Holds references to the views for each item, reducing findViewById() calls
Manages the scrolling behavior
Which of the following is NOT a core component of RecyclerView?
Adapter
LayoutManager
ViewHolder
Intent
Which LayoutManager arranges items in a linear list (vertical or horizontal) in RecyclerView?
GridLayoutManager
StaggeredGridLayoutManager
LinearLayoutManager
FlowLayoutManager
The purpose of dark mode in mobile design.
To save storage space
To increase brightness
To reduce typography scaling
To provide an alternative color scheme for better readability and energy efficiency
What is the main benefit of using RecyclerView over ListView for displaying large lists?
Simpler implementation for beginners
Improved performance and memory efficiency due to view recycling
Automatic data persistence
Better support for complex animations by default
Which layout container allows arranging views horizontally or vertically and resizing them automatically?
LinearLayout
RelativeLayout
StackView
FrameLayout
What property of a StackView determines how the views are arranged along the main axis?
Orientation
Alignment
Distribution
Spacing
Which StackView distribution option expands views to fill the available space evenly?
Fill Equally
Spaced Equally
Spaced Around
Spaced Between
Fonts in mobile UI design into two main categories.
Serif and Sans Serif
System fonts and custom fonts
Bold and Italic
Large and Small
How can you add a subview to a StackView programmatically?
stackView.addArrangedSubview(view)
stackView.addSubview(view)
stackView.insertSubview(view, at: index)
stackView.layoutIfNeeded()
What method allows you to remove a subview from a StackView and also from the view hierarchy?
stackView.removeArrangedSubview(view)
stackView.deleteSubview(view)
stackView.hideSubview(view)
stackView.removeFromSuperview()
What is the primary method for handling a button click in Android?
onClick()
onLongClick()
onTouch()
onFocusChange()
The role of themes in UI design.
To manage memory usage
To define consistent styles across the app
To render 3D animations
To store images
In iOS, which control event is typically associated with a button tap?
touchUpInside
touchDown
touchDragInside
valueChanged
How can you disable a button programmatically in Android?
button.setEnabled(false)
button.setVisible(false)
button.setClickable(false)
button.setFocusable(false)
Which attribute in Android XML layouts allows you to directly specify a click handler method?
android:onClick
android:onClickListener
android:clickAction
android:handleTap
Which attribute in Android XML layouts allows you to directly specify a click handler method?
android:onClick
android:onClickListener
android:clickAction
android:handleTap
Flexbox to align images in a gallery, the property that ensures the images are evenly spaced horizontally is.
alignItems: "stretch"
justifyContent: "space-between"
flexDirection: "column"
position: "absolute"
What is the main purpose of input validation in a form?
To prevent user errors and ensure data integrity
To beautify the form's appearance
To encrypt data transmission
To speed up form submission
Which of the following is NOT a common type of form input validation?
Checking if a field is empty
Verifying email address format
Confirming password strength
Sorting form data alphabetically
Where can form validation primarily occur?
Client-side only
Server-side only
Both Client-side and Server-side
Before any user interaction
What HTML5 input type is used for creating a single line text box for searching queries?
placeholder
search
url
hidden
What element is used for grouping form controls in HTML?
The modifier used to implement a dark mode toggle in Android with Jetpack Compose is.
colorScheme
ThemeManager
MaterialTheme
AdaptiveColors
What is a "tap" gesture?
A single touch and release on the screen
A long press on an element
Two fingers pinching
Swiping across the screen
Which gesture is commonly used for zooming in or out of content?
Pinch
Swipe
Rotate
Tap
Illustrate the way to ensure images in a gallery scale properly across different screen sizes.
Use responsive constraints/layout modifiers
Use fixed pixel values
Disable resizing
Convert to text
What is the primary benefit of using gesture-based interfaces in mobile apps?
Reduced development time
More efficient and user-friendly navigation
Easier debugging
Higher app store rankings
Which of the following is an example of a gesture-based interaction?
Typing text into a keyboard
Clicking a physical button
Swiping through images
Reading a barcode
Why is user feedback crucial for refining gesture design in mobile apps?
It helps developers understand how users naturally interact with the app
It determines the app's monetization strategy
It automates the testing process
It reduces the need for UI/UX designers
What framework or API in Android is commonly used for interacting with the camera?
Camera2 API
MediaRecorder
AudioManager
LocationManager
In iOS, what class is typically used to capture still images or video from the camera?
UIImagePickerController
AVFoundation framework
CLLocationManager
MediaPlayer framework
The reason system fonts are more preferable over custom fonts in a mobile app.
System fonts reduce screen size
System fonts make apps run offline
System fonts ensure faster rendering and better accessibility
System fonts allow database synchronization
What is a common step before starting a camera session to ensure the camera is available?
Check for camera presence and permissions
Start a background service
Display a fullscreen advertisement
Initialize the database
Which file in Android applications contains information about the app's components, permissions, and features, including camera access?
build.gradle
AndroidManifest.xml
styles.xml
strings.xml
An image gallery in Jetpack Compose by selecting the component best suited for displaying a scrollable grid of images.
Column
Row
LazyVerticalGrid
Box
Which native API allows a mobile app to determine the user's location?
Geolocation API
Camera API
Notifications API
Storage API
What method in the HTML Geolocation API is used to retrieve the user's current position?
getCurrentPosition()
getDirectPosition()
post()
getDirection()
What does getCurrentPosition() return in the HTML Geolocation API?
Only latitude
Only longitude
Direction
Coordinates of the object
The benefits of using Jetpack Compose vs XML for an image gallery app.
XML is declarative, Compose is imperative
Compose allows real-time previews, XML requires rebuilds
Compose uses constraints, XML uses Flexbox
XML supports dark mode better
Which method in the Geolocation API is like a car's GPS, continuously updating the user's position as they move?
watchPosition()
clearWatch()
getCurrentPosition()
showPosition()
What is the default value of the timeout option in getCurrentPosition()?
100
0
1000000
Infinity
Responsive design principles into structural and visual aspects by identifying the one that belongs to structural.
Font scaling
Dark mode
Grid-based layout adjustment
Theme colors
What are local notifications primarily used for?
Sending messages to other apps
Displaying system-wide alerts
Providing reminders and information outside the app's UI
Sharing data with other users
What is the purpose of the onCreate() method in an Android Activity?
Destroy the Activity
Save data to the database
Initialize the Activity components
Pause the Activity
On Android 13 and above, what permission must be requested before sending non-exempt notifications?
POST_NOTIFICATIONS
SEND_NOTIFICATIONS
ACCESS_NOTIFICATIONS
RECEIVE_NOTIFICATIONS
The correct keyword to declare a mutable variable in Kotlin.
var
val
let
const
What is SharedPreferences primarily used for in Android?
Storing large, structured data
Storing small amounts of primitive data
Storing network requests
Storing user accounts and passwords
Which data types can be directly stored in SharedPreferences?
Only Strings
Only Integers and Floats
Booleans, floats, ints, longs, and strings
Custom objects
How is data stored in SharedPreferences deleted?
Automatically after a certain time
By the user clearing application data or uninstalling the app
When the device is restarted
When the app is closed
Recall the default visibility modifier in Kotlin when none is specified.
internal
protected
public
private
What happens by default if a database migration is not provided when the Room database schema changes?
Room will crash
Room will automatically migrate the schema
Room will ask the user for permission
The app will continue to work without issues
What method is used to stop watchPosition() in the Geolocation API?
stopWatching()
clearWatch()
pauseWatching()
disableWatch()
Differentiate between val and var in Kotlin by selecting the true statement.
val is mutable, var is immutable
Both val and var are immutable
val is immutable, var is mutable
Both val and var are mutable
What object is used to make primitive bits of data persist across changes in the app lifecycle?
DatabaseHelper
SharedPreferences
OutputStream
Persistent
Implement a simple function in Kotlin that returns the sum of two integers by selecting the correct syntax.
def add(a: Int, b: Int) = a + b
fun add(a: Int, b: Int): Int = a + b
function add(a: Int, b: Int): Int { return a + b }
int add(a, b) { return a + b }
Which method is used to store and retrieve primitive data that only needs to be used by one activity?
getPrimitiveData()
getSharedPreferences()
getPreferences()
getActivityData()
Kotlin smart casting by selecting the statement that correctly demonstrates automatic type casting after a type check.
if (obj is String) { println(obj.length) }
if (obj is String) { println((obj as Int) + 1)}
val num: Int = "123"
if (obj !is String) { println(obj.length) }
Which type of database does CoreData use by default?
SQLite
Realm
Firebase
MongoDB
