WorksheetsMIDTERM EXAMINATION IN CTCC00603
Total questions: 50
Worksheet time: 38mins
What is Android Studio?
A text editor
The official IDE for Android development
A compiler for Java only
A mobile emulator
Which programming language is primarily used in Android app development?
C++
Java
Python
Swift
The res folder in an Android project contains:
Source code files
Build scripts
Resources like layouts, images, and strings
Database files
Which file describes the essential information about an Android app?
build.gradle
strings.xml
AndroidManifest.xml
activity_main.xml
To run an Android app on a physical device, what must be enabled?
Safe Mode
Bluetooth Debugging
USB Debugging
Cloud Sync
Which Gradle file typically manages module-level dependencies?
project build.gradle
settings.gradle
module build.gradle
manifest.gradle
The main activity of an Android app is usually named:
FirstActivity
MainActivity
AppActivity
StartActivity
Log messages in Android are viewed in:
Toast notifications
Debugger pane
Logcat pane
Manifest file
Which method is used to filter logcat messages?
search()
setFilter()
Log.filter()
Using tags
Which Android Studio pane allows you to design UI visually?
Logcat
Layout Editor
Gradle Console
Project View
What is the basic building block of Android UI?
Activity
View
Intent
Fragment
Which class is used to display text on the screen?
EditText
Button
TextView
ImageView
A ViewGroup is best described as:
A subclass of TextView
A container for other views
A type of button
A layout attribute
Which layout arranges its children in rows or columns?
RelativeLayout
LinearLayout
ConstraintLayout
FrameLayout
What is the root view in every layout hierarchy?
Button
TextView
ViewGroup
Constraint
Which unit should be used for text size in Android?
px
in
dp
sp
In XML, how do you set a resource string as a text value?
android:text="Hello"
android:text="@string/hello"
android:text="@color/hello"
android:text="@id/hello"
Which layout is best for designing complex UI with constraints?
ConstraintLayout
GridLayout
LinearLayout
FrameLayout
Which is NOT a property of a View?
Visibility
Interactivity
Focus
Package name
Which resource folder is used for images?
res/layout
res/values
res/drawable
res/xml
Which attribute defines how much space a view takes horizontally?
android:layout_margin
android:layout_gravity
android:layout_width
android:padding
Which layout stacks views on top of each other?
TableLayout
FrameLayout
GridLayout
RelativeLayout
What is the best practice for view hierarchies?
Deep nesting
Use as many custom views as possible
Keep hierarchy flat and simple
Avoid using layouts
Which class allows a scrollable list of views?
LinearLayout
ScrollView
FrameLayout
GridView
Which file stores string values for localization?
strings.xml
styles.xml
dimens.xml
colors.xml
What does @+id/ mean in XML?
Reference to a resource
Create a new ID
Add a new layout
Assign a string
To handle button clicks in XML, which attribute is used?
android:onPress
android:onClick
android:handler
android:action
The unit dp stands for:
Density-independent pixels
Device pixels
Data points
Dynamic property
Which view lets the user choose between multiple options?
CheckBox
RadioButton
Switch
SeekBar
In Java, how do you programmatically create a TextView?
new TextView()
TextView myText = new TextView(this);
TextView myText = new View();
TextView myText = new Layout();
What is an Activity in Android?
A background service
A UI component representing one screen
A layout manager
A fragment
The first activity a user sees is called:
Starting activity
Main activity
Root activity
Primary activity
How are activities declared to the Android system?
In strings.xml
In styles.xml
In the Android manifest
In build.gradle
Which method connects an activity with its layout?
onCreateLayout()
setContentView()
startActivity()
getLayoutInflater()
What is an Intent?
A UI widget
A description of an operation to perform
A type of layout
A method for debugging
Which type of intent starts a specific activity?
Explicit intent
Implicit intent
Internal intent
External intent
Which type of intent asks the system to find an appropriate app to handle the request?
Explicit intent
Implicit intent
Broadcast intent
Default intent
Which method starts an activity using an intent?
runActivity()
startService()
startActivity()
openActivity()
Which URI scheme is used to dial a phone number?
http://
tel:
sms:
call:
How do you send multiple key-value pairs with an Intent?
getExtras()
putExtras()
addBundle()
setValues()
Which method retrieves data from an Intent?
getValues()
getExtra()
getData()
fetchIntent()
Which method is used when expecting a result back from another activity?
startActivity()
startActivityForResult()
setResult()
returnActivity()
How is the returned data captured in the first activity?
onCreate()
onResultReceived()
onActivityResult()
getIntent()
Which constant indicates a successful result?
RESULT_SUCCESS
RESULT_DONE
RESULT_OK
RESULT_FINISHED
Android manages activities using what structure?
Linked list
Queue
Back stack
Tree
Back navigation in Android is controlled by:
Manifest settings
Back stack
Action bar
Home button
Up navigation is defined in:
Android Studio
Android manifest
strings.xml
build.gradle
Which method puts data inside an intent as a string?
putExtra(String name, String value)
setExtra(String name, String value)
addExtra(String name, String value)
insertExtra(String name, String value)
What does finish() do in an activity?
Restarts the app
Ends the current activity
Saves data permanently
Closes Android Studio
Which navigation method uses the action bar to move to a parent activity?
Back navigation
Forward navigation
Up navigation
Deep link navigation
