Lab 5 Self-Assessment
Lab 5 Self-Assessment
Q1 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
Q2 Every Android app would have a Android Manifest file, which does the following except
Answer: Defines the GUI of the MainActivity of the app
Q3 When the battery of an Android device is low, which of the following app component will be used to inform the user of the battery status?
Answer: Broadcast Receivers
Answer:
Q6 What is the Android Application Component used to provide background tasks?
Answer: Service
Q7
Suppose that there are two activities in an application named ActivityOne and ActivityTwo. You want to invoke ActivityTwo from ActivityOne. What code you will write? (There is more than 1 answer)
Answer:
Intent intent=new Intent (this, ActivityTwo.class);
startActivity(intent);
startActivity(new Intent(this, ActivityTwo.class));
Q8
If you want to navigate from one activity to another activity, which android class would you use to do that?
Answer: Intent
Q9
Suppose that there are two activities in an application named FirstActivity and SecondActivity. You want to send website name from the FirstActivity to the SecondActivity. What code you will write? Suppose that website name is "CareerRide.com"
Answer:
Intent intent=new Intent (this, SecondActivity.class);
intent.putExtra("name", "CareerRide.com");
startActivity(intent);
Q10
What are the files that are stored in the res/values folder of the Android app in Android Studio? (Choose all that apply)
Answer: all correct except activity_main.xml
Q11
Which of the following layout in android aligns all children either vertically or horizontally?
Answer: LinearLayout
Comments
Post a Comment