Font size
WorksheetsAMAD Exam
Total questions: 30
Worksheet time: 39mins
What is the key advantage of Jetpack Compose over traditional Android development?
What is the first step in creating a new Jetpack Compose project?
Which layout file is used in the Jetpack Compose project?
activity_main.xml
content_main.xml
main_layout.xml
None of the choices
What is the equivalent of a TextView in Jetpack Compose?
How is the text "Hello World" displayed on the screen?
By using a TextView element
By calling the setText() method
By passing the string "Hello World" to the Text() composable
By defining a string variable with the value "Hello World"
What composable is used to arrange UI elements in a horizontal line?
What composable is used to arrange UI elements in a vertical line?
What is the equivalent of a Button in Jetpack Compose?
ButtonView
Clickable
What is the purpose of the setcontent() method?
What is the main advantage of using Jetpack Compose for UI development?
It allows for more complex UI designs.
It simplifies UI development and makes it more efficient.
What is the purpose of the Modifier object in Jetpack Compose?
To apply styling and layout properties to composables
Which composable is used for the email and password input fields?
TextField
OutlinedTextField
InputBox
Text
How is the spacing between the social media login icons managed?
By using the spaceAround modifier
By using the spaceBetween modifier
By using the spaceEvenly modifier
By manually setting margins on each icon
What is the purpose of the remember function in Jetpack Compose?
To store data that persists across recompositions
To define animations for UI elements
To handle user input events
To create reusable UI components
How are the values entered in the email and password fields stored?
In global variables
In local variables within the composable function
In a database
In MutableState objects
What is the key component responsible for managing navigation in Jetpack Compose?
Which function is used to create a new NavController instance within a composable?
How are arguments passed from one screen to another during navigation?
By using the putExtra() method
By appending them to the route string
By using shared preferences
By passing them as function parameters
What is the purpose of the onClick parameter in the Button composable?
To define the action to be performed when the button is clicked
To set the text displayed on the button
To change the color of the button
To disable the button
What is the purpose of the Text composable in Jetpack Compose?
Which of the following variable declarations is valid?
var hello: Int? = ""
String "hello" = hello
val hello = "hello"
hello: String = "hello"
It is considered best practice to declare a variable that will not change using var instead of val.
Which of the following are valid ways to update a variable? (Choose as many answers as you see fit.)
total++
total - 1
total--
total = total + 1
In Kotlin, comments can be single or multi-line and are ignored by the compiler.
True
False
Which of the following is not a data type in Kotlin?
String
Decimal
Int
Boolean
Float also represents a decimal, but is less precise than Double.
True
False
In Kotlin, the entrypoint of a program is the ___.
println() statement
val variable
return statement
main() function
Which of the following are true about function return values?
(Choose as many answers as you see fit)
If a function does not specify a return type, the return type is Unit.
A return value can be stored in a variable.
Functions with a return type of Unit must include a return statement.
A return value's type must match the return type of a function.
Which of the following are true about functions?
(Choose as many answers as you see fit)
Functions can take parameters, or variables as inputs.
Function parameters are required to have default arguments.
When calling a function with parameters, the values passed in are called arguments.
Breaking up your code into separate functions makes your code easier to maintain.
With named arguments, you can change the order in which you pass arguments into a function.
