[go: up one dir, main page]

0% found this document useful (0 votes)
17 views13 pages

android_3

The document outlines a midterm exam for the IT4785E course, featuring multiple-choice and fill-in-the-blank questions related to Android programming concepts. Topics include intents, activity lifecycle, view groups, and the use of fragments, among others. Each question specifies a point value and indicates that results are not displayed or accumulated.

Uploaded by

Ha Cao Thu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views13 pages

android_3

The document outlines a midterm exam for the IT4785E course, featuring multiple-choice and fill-in-the-blank questions related to Android programming concepts. Topics include intents, activity lifecycle, view groups, and the use of fragments, among others. Each question specifies a point value and indicates that results are not displayed or accumulated.

Uploaded by

Ha Cao Thu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

12/9/23, 2:03 PM Unit | Midterm_Exams | Chương trình học của IT4785E | MOOC daotao.

ai

 Khóa học  Exams  Midterm_Exams  Unit

1 2 3 4 5

6 7 8 9 10

11 12 13 14 15

16 17 18 19 20

21 22 23 24 25

26 27 28 29 30

31 32 33 34 35

36 37 38 39 40

41 42 43 44 45

Unit
Câu hỏi #f2514b
2 điểm (không tích lũy, không hiển thị kết quả

Given following code, select the correct :

val address =

Uri Answer:

.parse("https://soict.hust.edu.vn")

val intent:Intent = Intent(Intent.ACTION_VIEW,

address Answer:

startActivity(intent)

Gửi

Câu hỏi #46d692


1 điểm (không tích lũy, không hiển thị kết quả

Which of following is wrong about implicit intent?

To call implicit, you have to know the class name of the destination activity

Android runtime will open the app chooser if there exists more than one candidate for the implicit intent

Android runtime receive the requests and try to find the matched application

Android runtime keeps list of application registering to run the implicit intent

https://soict.daotao.ai/courses/course-v1:SoICT+IT4785E+2023-1-143671/courseware/1cdb04ee0b3149348a3b5357f93c8660/aa62cd3c2880414c96acf9da604a8d48/?activate_block_id=block-v1%3ASoICT%2BIT4785E%2B2023-1-14… 1/13
12/9/23, 2:03 PM Unit | Midterm_Exams | Chương trình học của IT4785E | MOOC daotao.ai

Gửi

Câu hỏi #b938d7


1 điểm (không tích lũy, không hiển thị kết quả

The RadioGroup class is directly inherited from which class?

LinearLayout

RelativeLayout

android.widget.view

ConstrainLayout

ViewGroup

Gửi

Câu hỏi #ebd7d8


1 điểm (không tích lũy, không hiển thị kết quả

Which of the following is false about intents?

Intents are performed using the startActivity() method.

An implicit intent always results in the system asking the user which app to open

Explicit intents require you to specify the class of the activity you want to show.

Both implicit and explicit intents allow your app to launch another activity.

Gửi

Câu hỏi #e5044b


1 điểm (không tích lũy, không hiển thị kết quả

Which of the following are true about abstract classes?

They can be extended by subclasses and implementations can be provided for abstract members of the class.

They have an implementation for all of their properties and functions.

They may have abstract properties or abstract functions.

They can be instantiated.

They are not fully implemented and cannot be instantiated.

They need to be marked with the open keyword to be extended.

Gửi

Câu hỏi #93fb9b


1 điểm (không tích lũy, không hiển thị kết quả

What is the language to program Android natively (select all correct answers)?

Java

https://soict.daotao.ai/courses/course-v1:SoICT+IT4785E+2023-1-143671/courseware/1cdb04ee0b3149348a3b5357f93c8660/aa62cd3c2880414c96acf9da604a8d48/?activate_block_id=block-v1%3ASoICT%2BIT4785E%2B2023-1-14… 2/13
12/9/23, 2:03 PM Unit | Midterm_Exams | Chương trình học của IT4785E | MOOC daotao.ai

HTML, CSS, Javascript

Kotlin

C/C++

Gửi

Câu hỏi #e55206


1 điểm (không tích lũy, không hiển thị kết quả

In case the activity has too many input controls so that the layout height is over the height of the phone's screen, which ViewGroup should be used?

ScrollView

LinearLayout

HorizontalScrollView

VerticalScrollView

Gửi

Câu hỏi #a77212


1 điểm (không tích lũy, không hiển thị kết quả

Which of the following is not a challange for Android application development?

The deverloper may have to use different development tools in different OS

The application must have compatibility with several different versions of Android

The application mus be designed for multiple resolutions

Source code and user's data must be secured

Gửi

Câu hỏi #9eb4bb


1 điểm (không tích lũy, không hiển thị kết quả

An activity contains the following code in onCreate() . What will happen when this code is executed, if the intent property is null?

val message = intent.extras?.getString("message").toString()

The app will not crash because the extras property is accessed safely using ?.

The app will crash because it attempted to access a null object.

The app will not crash because the extras property is accessed unsafely using ?.

The app will crash because it attempted to access the extras property on a null object.

Gửi

Câu hỏi #8a4ed9


1 điểm (không tích lũy, không hiển thị kết quả

https://soict.daotao.ai/courses/course-v1:SoICT+IT4785E+2023-1-143671/courseware/1cdb04ee0b3149348a3b5357f93c8660/aa62cd3c2880414c96acf9da604a8d48/?activate_block_id=block-v1%3ASoICT%2BIT4785E%2B2023-1-14… 3/13
12/9/23, 2:03 PM Unit | Midterm_Exams | Chương trình học của IT4785E | MOOC daotao.ai

Which of the following is a benefit of using fragments?

Navigation between fragments allows for more sophisticated user interface patterns, such as tab bars.

Using multiple fragments within an activity allows for an adaptive layout across multiple screen sizes.

The same fragments can be reused across multiple activities.

Frragment is more lightweight than ACtivity sothat we should use Fragment rather than

Gửi

Câu hỏi #3449ea


1 điểm (không tích lũy, không hiển thị kết quả

Which widget view could be used to make a clickable object with image content?

Button

ImageButton

ImageView

Image

TextView

Gửi

Câu hỏi #e1a030


1 điểm (không tích lũy, không hiển thị kết quả

Where to configure the home activity - the first activity to be run in your application?

in the AndroidManifest.xml

in the project level gradle file

in the MainActivity.kt

in the module level gradle file

Gửi

Câu hỏi #be5089


1 điểm (không tích lũy, không hiển thị kết quả

To make the EditText allows password characters (e.g., display * instead of the real character), you have to set the value of the inputType property
as (type your answer with case sensitive)

textPassword Answer:

Gửi

Câu hỏi #997eac


1 điểm (không tích lũy, không hiển thị kết quả

Which of the following statements about app icons are true?

https://soict.daotao.ai/courses/course-v1:SoICT+IT4785E+2023-1-143671/courseware/1cdb04ee0b3149348a3b5357f93c8660/aa62cd3c2880414c96acf9da604a8d48/?activate_block_id=block-v1%3ASoICT%2BIT4785E%2B2023-1-14… 4/13
12/9/23, 2:03 PM Unit | Midterm_Exams | Chương trình học của IT4785E | MOOC daotao.ai

It is sufficient to provide a single bitmap image of your app icon in your project to make it appear high quality on a range of Android devices.

mdpi, hdpi, xhdpi, xxhdpi, and xxxhdpi are density qualifiers for resource directories to indicate that these are resources to be used on
devices with a specific screen density.

Adaptive icons are made up of a foreground and background layer, and an OEM mask will be applied on top of them.

Vector drawables only work for a certain screen density and should not be scaled.

Gửi

Câu hỏi #1556f7


1 điểm (không tích lũy, không hiển thị kết quả

Which value of the property scaleType of the ImageView allows us to keep remaining the aspect ratio (the image will not be croped)?

centerInside

fitXY

centerCrop

center

Gửi

Câu hỏi #7c0d76


1 điểm (không tích lũy, không hiển thị kết quả

Which of following components belong to android native library?

1) Webkit

2) OpenGL

3) SQLite

4) Dalvik

5) OpenUI

1,3,4

1,2,3

1,2,5

3,4,5

Gửi

Câu hỏi #3453c1


1 điểm (không tích lũy, không hiển thị kết quả

Fill in the blank

The

createInstance() Answer:

is called when you create an instance of a class.

https://soict.daotao.ai/courses/course-v1:SoICT+IT4785E+2023-1-143671/courseware/1cdb04ee0b3149348a3b5357f93c8660/aa62cd3c2880414c96acf9da604a8d48/?activate_block_id=block-v1%3ASoICT%2BIT4785E%2B2023-1-14… 5/13
12/9/23, 2:03 PM Unit | Midterm_Exams | Chương trình học của IT4785E | MOOC daotao.ai

Gửi

Câu hỏi #3d987c


1 điểm (không tích lũy, không hiển thị kết quả

What is the purpose of using RadioGroup ?

to group RadioButton objects

to arrange RadioButton objects by rows or by columns

to replace the LinearLayout

to make a RadioButton acts like a CheckBox

to identify which RadioButton is selected

Gửi

Câu hỏi #3763c6


1 điểm (không tích lũy, không hiển thị kết quả

If you activity has the name: SampleActivity, what is the name of the binding class which is generated automatically by Android when you
configure your application as data binding enable?

sample_activity_binding

ActivitySampleBinding

activity_sample_binding

SampleActivityBinding

Gửi

Câu hỏi #207b57


1 điểm (không tích lũy, không hiển thị kết quả

The (fill in the blank with case sensitive)

onSupportNavigateUp Answer:

method needs to be overridden in the host activity to ensure your app’s fragment-based navigation responds to the app’s "Up" button?

Gửi

Câu hỏi #ccbc60


1 điểm (không tích lũy, không hiển thị kết quả

Why use the Material Components for Android library?

It provides widgets that follow the Material Design guidelines such as text fields and switches.

It makes your code compile faster.

It provides default Material themes that you can use directly or extend and then customize.

It automatically suggests ways for your app to look better.

https://soict.daotao.ai/courses/course-v1:SoICT+IT4785E+2023-1-143671/courseware/1cdb04ee0b3149348a3b5357f93c8660/aa62cd3c2880414c96acf9da604a8d48/?activate_block_id=block-v1%3ASoICT%2BIT4785E%2B2023-1-14… 6/13
12/9/23, 2:03 PM Unit | Midterm_Exams | Chương trình học của IT4785E | MOOC daotao.ai

It helps you more quickly build beautiful user experiences.

Gửi

Câu hỏi #b087d9


1 điểm (không tích lũy, không hiển thị kết quả

Which activity lifecycle method would be called if a dialog appears onscreen, partially obscuring an activity?

onDestroy() because the activity does not need to exist so long as it doesn’t have focus.

onStop() because the activity does not need to respond to user input while the dialog is onscreen.

onResume() because the activity needed to respond to user input to display the dialog.

onPause() because the activity is still displayed, but no longer has focus.

Gửi

Câu hỏi #a45efd


1 điểm (không tích lũy, không hiển thị kết quả

In the fragment lifecycle, which of the following tasks should be performed in onViewCreated() ?

Inflating the layou

Binding view objects to properties in your fragment

Configuring the options menu

Setting properties of individual views, such as a recycler view’s adapter

Gửi

Câu hỏi #c46862


1 điểm (không tích lũy, không hiển thị kết quả

Which is the direct parent class of the Button class?

android.widget.View

android.view.TextView

android.view.View

android.widget.TextView

Gửi

Câu hỏi #383c31


1 điểm (không tích lũy, không hiển thị kết quả

Which of the following is true about Gradle?

Gradle is an automated build system used by Android Studio to build your apps.

Gradle handles installing your app on a device

https://soict.daotao.ai/courses/course-v1:SoICT+IT4785E+2023-1-143671/courseware/1cdb04ee0b3149348a3b5357f93c8660/aa62cd3c2880414c96acf9da604a8d48/?activate_block_id=block-v1%3ASoICT%2BIT4785E%2B2023-1-14… 7/13
12/9/23, 2:03 PM Unit | Midterm_Exams | Chương trình học của IT4785E | MOOC daotao.ai

Your app’s build.gradle file is written in XML.

You can configure Android-specific options for your project in your app’s build.gradle file.

The gradle configuration for your project cannot change after you initially create the project.

Gửi

Câu hỏi #dd28ad


1 điểm (không tích lũy, không hiển thị kết quả

Overdiding the callback onSaveInstanceState is not suitable in which situation?

save some states of Activity and restore latter when there is a device configuration changed

save some states of Activity and restore latter when user rotates the device screen

save some states of Activity and restore latter when user changes the language of the device

store data into SD card to permanently use latter

Gửi

Câu hỏi #49d845


1 điểm (không tích lũy, không hiển thị kết quả

What is the flexible point of Android devices compare to iOS ones?

user data is more secured

can connect to multiple peripheral devices such as mouse or keyboard

backup and restore data easily with cloud services

allow to install apps from third party sources (not from Google play store)

Gửi

Câu hỏi #65ef14


1 điểm (không tích lũy, không hiển thị kết quả

The res folder does not include which following resources?

file to define dependence libraries used in project

file to define strings, colors used in project

file to define demensions used in project

file to define the menu structure used in project

Gửi

Câu hỏi #f196dc


1 điểm (không tích lũy, không hiển thị kết quả

How to handle the event that user press the button and hold for a while?

https://soict.daotao.ai/courses/course-v1:SoICT+IT4785E+2023-1-143671/courseware/1cdb04ee0b3149348a3b5357f93c8660/aa62cd3c2880414c96acf9da604a8d48/?activate_block_id=block-v1%3ASoICT%2BIT4785E%2B2023-1-14… 8/13
12/9/23, 2:03 PM Unit | Midterm_Exams | Chương trình học của IT4785E | MOOC daotao.ai

setLongClickListener

setOnLongClickListener

setOnClickListener

setOnLongTouchListener

Gửi

Câu hỏi #33108


1 điểm (không tích lũy, không hiển thị kết quả

What is the advantage of Android development environment compare to iOS development environment?

the UI experience is better

can develop app on several operating systems

easier to test on real devices

can use several IDEs for app development

Gửi

Câu hỏi #d879


1 điểm (không tích lũy, không hiển thị kết quả

The 'when' statement in Kotlin is similar to which statement in other programming languages?

continue

break

switch

if

Gửi

Câu hỏi #9b3


1 điểm (không tích lũy, không hiển thị kết quả

Suppose we have an image named "mobile.png" in the res/drawable folder, and we have an ImageView in the activity layout, which method could
be used to set the image source for the ImageView as the image mobile.png

setImageResource(R.id.mobile)

setImageResource(R.drawable.mobile)

setImageDrawable(R.drawable.mobile)

setImageResource(R.drawable.mobile.png)

Gửi

Câu hỏi #37


1 điểm (không tích lũy, không hiển thị kết quả

https://soict.daotao.ai/courses/course-v1:SoICT+IT4785E+2023-1-143671/courseware/1cdb04ee0b3149348a3b5357f93c8660/aa62cd3c2880414c96acf9da604a8d48/?activate_block_id=block-v1%3ASoICT%2BIT4785E%2B2023-1-14… 9/13
12/9/23, 2:03 PM Unit | Midterm_Exams | Chương trình học của IT4785E | MOOC daotao.ai

What is the function to open new activity from the current activity?

newActivity

beginActivity

startActivity

openActivity

Gửi

Câu hỏi #e
1 điểm (không tích lũy, không hiển thị kết quả

Given following code:

val intent = Intent([ ], Uri.parse("123456789"))

intent.putExtra("sms_body", "hello")

startActivity(intent)

what could be filled in the [ ]?

Intent.ACTION_SEND_SMS

Intent.ACTION_SEND

Intent.ACTION_SEND_MULTIPLE

Intent.ACTION_SENDTO

Gửi

Câu hỏi #94ae03


1 điểm (không tích lũy, không hiển thị kết quả

Suppose we write an application to survey the hobby of people (there are 5 hobbies to be surveyed), one person may have several hobbies. Which
input controls is suitable for this purpose?

RadioButton

Recycler View

DropDownList

ListView

Checkbox

Gửi

Câu hỏi #17734a


1 điểm (không tích lũy, không hiển thị kết quả

How to shutdown/finish an activity?

destroy()

finish()

https://soict.daotao.ai/courses/course-v1:SoICT+IT4785E+2023-1-143671/courseware/1cdb04ee0b3149348a3b5357f93c8660/aa62cd3c2880414c96acf9da604a8d48/?activate_block_id=block-v1%3ASoICT%2BIT4785E%2B2023-1-1… 10/13
12/9/23, 2:03 PM Unit | Midterm_Exams | Chương trình học của IT4785E | MOOC daotao.ai

dispose()

finishActivity()

Gửi

Câu hỏi #9fc597


1 điểm (không tích lũy, không hiển thị kết quả

What is the purpose of implicit intent?

to close an activity in other application

to open an service in current application

to open an activity in other application

to open an activity in current application

Gửi

Câu hỏi #fd8076


1 điểm (không tích lũy, không hiển thị kết quả

If you override onCreateOptionMenu callback in your activity, which menu are you going to create?

Popup Menu

ActionBar Menu

Context Menu

Navigation Drawer Menu

Gửi

Câu hỏi #72ce70


1 điểm (không tích lũy, không hiển thị kết quả

Which of the following tasks can be performed in onCreate() ?

Configuring views, such as setting the layout manager of a recycler view

Determining the items to be shown in the options menu.

Setting the onClickListener for items in the options menu.

Getting extras from the intent that launched the activity.

Gửi

Câu hỏi #acc715


1 điểm (không tích lũy, không hiển thị kết quả

What is the intent action to open a web page?

Intent.ACTION_ACCESS_INTERNET

https://soict.daotao.ai/courses/course-v1:SoICT+IT4785E+2023-1-143671/courseware/1cdb04ee0b3149348a3b5357f93c8660/aa62cd3c2880414c96acf9da604a8d48/?activate_block_id=block-v1%3ASoICT%2BIT4785E%2B2023-1-1… 11/13
12/9/23, 2:03 PM Unit | Midterm_Exams | Chương trình học của IT4785E | MOOC daotao.ai

Intent.ACTION_WEB_VIEW

Intent.ACTION_MAIN

Intent.ACTION_GET_CONTENT

Intent.ACTION_VIEW

Gửi

Câu hỏi #bf456c


1 điểm (không tích lũy, không hiển thị kết quả

If we have some buttons in one Activity, and all the buttons set the event onClickListener to the Activity by calling setOnClickListener(this) . So, in
the callback function onClick of the Activity, how do you know which button is clicked?

based on the order of buttons inside the xml layout file

based on the name of each button

based on the position of each button

based on the id of each button

Gửi

Câu hỏi #301977


1 điểm (không tích lũy, không hiển thị kết quả

Both Toast and Logcat can be used to debug the program, which expression bellow is wrong?

Toast displays information at device while Logcat displays information at the host

Logcat only display information that developer logs out

Logcat can not be shown on computer without connection between the computer and the Android device

Toast can be used to display some guidelines for user

Gửi

Câu hỏi #3d941f


1 điểm (không tích lũy, không hiển thị kết quả

What are lambdas in Kotlin?

A lambda is an expression that describes a function. But instead of declaring a named function, you declare a function that has no name

A lambda is a Class type in Kotlin

A lambda is an Interface in Kotlin

A lambda is a Data Type in Kotlin

Gửi

Câu hỏi #fa071b


1 điểm (không tích lũy, không hiển thị kết quả

https://soict.daotao.ai/courses/course-v1:SoICT+IT4785E+2023-1-143671/courseware/1cdb04ee0b3149348a3b5357f93c8660/aa62cd3c2880414c96acf9da604a8d48/?activate_block_id=block-v1%3ASoICT%2BIT4785E%2B2023-1-1… 12/13
12/9/23, 2:03 PM Unit | Midterm_Exams | Chương trình học của IT4785E | MOOC daotao.ai

Select all answers that are true for this XML layout when displayed on the screen.

TextView A appears vertically stacked on top of TextView B.

The starting edge of TextView A is aligned to the starting edge of the parent view.

The starting edge of TextView B is aligned to the starting edge of the parent view.

TextView B is horizontally and vertically centered within the parent.

The tops of TextView A and TextView B are aligned to top of the parent view.

The width of TextView A matches the width of the parent ConstraintLayout.

Gửi

Câu hỏi #332159


1 điểm (không tích lũy, không hiển thị kết quả

Which kind of menu will be opened if user presses and hold for a while?

Instant Menu

Context Menu

Drawer Menu

https://soict.daotao.ai/courses/course-v1:SoICT+IT4785E+2023-1-143671/courseware/1cdb04ee0b3149348a3b5357f93c8660/aa62cd3c2880414c96acf9da604a8d48/?activate_block_id=block-v1%3ASoICT%2BIT4785E%2B2023-1-1… 13/13

You might also like