Đề và đáp án trắc nghiệm MobileQuiz| Đề thi Phát triển ứng dụng cho thiết bị di động| Trường Đại học Bách Khoa Hà Nội
Đề và đáp án trắc nghiệm MobileQuiz| Đề thi Phát triển ứng dụng cho thiết bị di động| Trường Đại học Bách Khoa Hà Nội. Tài liệu gồm 6 trang giúp bạn ôn tập và đạt kết quả cao trong kỳ thi sắp tới. Mời bạn đọc đón xem.
Môn: Phát triển ứng dụng cho thiết bị di động
Trường: Đại học Bách Khoa Hà Nội
Thông tin:
Tác giả:
Preview text:
Which of fol owing components belong to android native library? 1) Webkit 2) OpenGL 3) SQLite 4) Dalvik 5) OpenUI A: 3, 4 ,5
The RadioGroup class is directly inherited from which class? A: LinearLayout
Which widget view could be used to make a clickable object with image content? A: ImageButton, ImageView
An activity contains the fol owing code in onCreate() . What wil happen when this code is
executed, if the intent property is nul ?
val message = intent.extras?.getString("message").toString()
A: The app wil not crash because the extras property is accessed safely using ?.
What is the intent action to open a web page? A: Intent.ACTION_VIEW
What is the language to program Android natively (select al correct answers)? A: Java, Kotlin, C/C++
Where to configure the home activity - the first activity to be run in your application? A: in the AndroidManifest.xml What are lambdas in Kotlin?
A: A lambda is an expression that describes a function. But instead of declaring a named
function, you declare a function that has no name
Both Toast and Logcat can be used to debug the program, which expression bel ow is wrong?
A: Logcat only display information that developer logs out
A: store data into SD card to permanently use latter
Which of the fol owing are true about abstract classes?
A: They can be extended by subclasses and implementations can be provided for abstract
members of the class. They may have abstract properties or abstract functions. They are not
ful y implemented and cannot be instantiated. They need to be marked with the open keyword to be extended.
If you activity has the name: SampleActivity, what is the name of the binding class which is
generated automatical y by Android when you configure your application as data binding enable A: SampleActivityBinding
Which of the fol owing tasks can be performed in onCreate()?
A: Getting extras from the intent that launched the activity.
Inflate the activity's layout: The setContentView() method is cal ed to inflate the activity's layout
into the activity's view hierarchy. This means that the UI elements that are defined in the layout file are
created and added to the activity's view hierarchy.
Initialize the activity's data: If the activity needs to load any data from the user or from the network, it
can do so in the onCreate() method. This is because the activity has not yet been started, so it is
safe to perform any necessary data loading without worrying about the user's interaction with the activity. Bind the activity's data
to the UI: Once the activity's data has been loaded, it can be bound to
the UI elements in the layout. This means that the data wil be displayed to
the user in a way that is relevant to the activity's functionality. Start any background
tasks: If the activity needs to perform any background tasks, such as
loading data from the network or updating the user's location, it can start
them in the onCreate() method. This is because
the activity is already running, so it can start the background tasks without
waiting for the user to interact with the activity. Handle any data that was
passed to the activity from the previous activity: If the
activity was started with an intent, the onCreate() method can access the
data that was passed to the activity using the intent
property. This data can be used to personalize the activity for the user or to
perform any other necessary tasks.
Given fol owing code, select the correct :
val address = URL .parse("https://soict.hust.edu.vn")
val intent:Intent = Intent(Intent.ACTION_VIEW, address ) startActivity(intent)
Which of the fol owing is true about Gradle?
A: Gradle is an automated build system used by Android Studio to build your apps. You can
configure Android-specific options for your project in your app’s build.gradle file.
What is the function to open new activity from the current activity? A: startActivity
The OBJECT is cal ed when you create an instance of a class.
What is the purpose of using RadioGroup?
A: to group RadioButton objects. to identify which RadioButton is selected
A: to open an activity in other application
Why use the Material Components for Android library?
A: It provides widgets that fol ow the Material Design guidelines such as text fields and
switches. It provides default Material themes that you can use directly or extend and then
customize. It helps you more quickly build beautiful user experiences.
Which is the direct parent class of the Button class? A: android.view.TextView
ONSUPPORTNAVIGATEUP() method needs to be overridden in the host activity to ensure
your app’s fragment-based navigation responds to the app’s "Up" button?
A: onCreate(), onStart(), onResume(), onPause(), onStop(), onRestart(), onDestroy()
Which value of the property scaleType of the ImageView al ows us to keep remaining the
aspect ratio (the image wil not be croped)? A: centerInside
Select al answers that are true for this XML layout when displayed on the screen
A: TextView A appears vertical y stacked on top of TextView B.
The starting edge of TextView A is aligned to the starting edge of the parent view.
TextView B is horizontal y and vertical y centered within the parent view.
How to handle the event that user press the button and hold for a while? A: setOnLongClickListener
If we have some buttons in one Activity, and al the buttons set the event onClickListener to
the Activity by cal ing setOnClickListener(this) . So, in the cal back function onClick of the
Activity, how do you know which button is clicked
A: based on the id of each button
Which activity lifecycle method would be cal ed if a dialog appears onscreen, partial y obscuring an activity?
A: onPause() because the activity is stil displayed, but no longer has focus.
True or False: onCreateView() is only cal ed once for a fragment’s entire lifecycle A: True
How to shutdown/finish an activity? A: finish()
Which of fol owing is wrong about implicit intent?
A: To cal implicit, you have to know the class name of the destination activity
The 'when' statement in Kotlin is similar to which statement in other programming languages? A: switch
Which of the fol owing is a benefit of using fragments?
A: Navigation between fragments al ows for more sophisticated user interface patterns, such
as tab bars.. Using multiple fragments within an activity al ows for an adaptive layout across
multiple screen sizes. The same fragments can be reused across multiple activities. Given fol owing code:
val intent = Intent([ ], Uri.parse("123456789"))
intent.putExtra("sms_body", "hel o") startActivity(intent)
what could be fil ed in the [ ] A: Intent.ACTION_SENDTO
Which is a possible way/language to develop Android application?
A: Native approach: Java/Kotlin. Object C. Flutter
When is the current Activity reset, i.e., the onCreate cal back is cal ed again?
A: user rotates the phone. user changes the language of the phone. user presses the home button and opens another app
Which of the fol owing is not a chal ange for Android application development?
A: Which of the fol owing is not a chal ange for Android application development?
In the fragment lifecycle, which of the fol owing tasks should be performed in onViewCreated() ?
A: Initialize UI elements: Load data. Set up adapters. Perform UI updates
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? A: Checkbox
What is the advantage of Android development environment compare to iOS development environment?
A: Open Source and Cross-Platform. Large Developer Community. Java and Kotlin Support. Cost-Effectiveness