Lab 4 Self Assessment
Lab4 Self Assessment
Q1 The following programming languages can be used to create Android app except
Answer : PHP
Q2
There are four different types of app component in an Android app. Which one of these app components do not require Intent to activate it?
Answer : Content Providers
Q3
In a life cycle of an Android Activity, choose the correct order of the various callbacks
Answer : onCreate() -> onStart() ->onResume() -> onPause() -> onStop() -> onDestroy()
Q4
At which callback in the life cycle of an Android Activity should the View layout of the Activity be loaded?
Answer : onCreate()
Q5
Answer :
Q6
In Android layout, which of the following statements describes a View object and a ViewGroup object correctly?
Answer :
A View usually draws something the user can see and interact with, whereas a ViewGroup is an invisible container that defines the layout structure for View or other ViewGroup objects
Q7
What are some advantages of Mobile Devices? (There are more than one answer)
Answer :
All correct except Offline Web Storage support
Q8What is the name of the API in Android Application Framework used to build GUI?
Answer : View System
Q9 Which of the following is responsible for the management of the lifecycle of applications?
Answer :
Activity Manager
Q10 Which of the following objects belong to the ViewGroup in Android Layout? (Choose all that apply)
Answer :
ConstraintLayout and LinearLayout
Q11The Android Activity Layout XML file is normally stored in which folder of the project directory in Android Studio?
Answer :
res/layout
Q12
In which Activity callback does the layout resource for the Activity is loaded?
Answer :
onCreate()
Q13
Which line of code will load the layout resource for the Activity?
Answer :
setContentView
Q14Given the following xml codes for the button in the layout file, what is the correct Java codes to access this button?

Answer :
Button b = (Button) findViewbyId (R.id.my_button);
Q15
In the following xml layout codes, what is the root element?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a TextView" />
<Button android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a Button" />
</LinearLayout>
Answer :
LinearLayout
Comments
Post a Comment