Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Chapter 18 Knowledge Testing


May 21, 2021 Android SDK Getting started


Table of contents


Chapter 18 Knowledge Testing

Tutorial instructions

Completion time: 15 minutes

Difficulty of execution: Simple

Earlier, we learned about the basic concepts and key points of knowledge that need to be involved in creating applications for the Android platform. A long the way, we explored various aspects of Android development, including Java development, XML usage, user interface design, project structure, data storage, and the publishing process. In order to test the effectiveness of our study, in today's article, please accept a closing test to see if you have mastered the previously mentioned knowledge.

Question one

Which of the following Android application directories is our Java class saved?

  1. Res
  2. layout
  3. Src
  4. values

Question two

Which of the following will we not do in the project inventory file?

  1. Declare the activity in the application.
  2. Set the minimum API support level.
  3. Defines what events are performed after the button is clicked.
  4. List the permissions that are required for the application to run.

Question three

Which of the following statements should we use in order to retrieve the id of a view set in XML in Java using the "id/how" syntax?

  1. R.how
  2. R.view.how
  3. findViewById(how)
  4. R.id.how

Question four

Which of the following statements should we use to set the text string displayed by TextView in XML?

  1. android:text='@string/info'
  2. android:string='info'
  3. android:text='@text/info'
  4. android:value='@string/info'

Question five

Which of the following is the standard way we define the events that a user performs when they click a button?

  1. onClickListener
  2. onViewClick
  3. onClick
  4. onButtonClick

Question six

Which of the following XML properties do we need to add to the view to specify how the user will click?

  1. android:onClick
  2. android:click
  3. android:clickListener
  4. android:clicked

Question seven

Which of the following statements do we need to set up a drawable display graph in ImageView?

  1. android:img='@drawable/my_shape'
  2. android:shape='@drawable/my_shape'
  3. android:drawable='@drawable/my_shape'
  4. android:src='@drawable/my_shape'

Question 8

Which of the following activity elements do we need to include in the manifest to execute the activity when the application starts from the device menu?

  1. The name of the application contained in a property.
  2. Primary and initiator properties.
  3. The main action and the launcher type element.
  4. The main type and the initiator action element.

Question nine

In which element do we need to declare the permissions that the application requires in the manifest?

  1. permission
  2. request-permission
  3. permission-required
  4. uses-permission

Question ten

What is the application's Shared Preferences for?

  1. The key value pair that holds the original data item.
  2. The structured data is saved as rows and columns in the table.
  3. Retrieving Internet data.
  4. Save the data in an external file on the user's device.

Question 11

How do we handle I/O errors when an application reads and writes files?

  1. Double-check the file name string.
  2. Place our I/O code in a separate class.
  3. Try and get blocks of data related to the I/O code.
  4. Output a warning message to the user.

Question twelve

Which of the following steps does our application not need to follow before attempting to write to an external storage mechanism?

  1. Check that an external storage mechanism is available.
  2. Check write access to the external storage mechanism.
  3. Use the permissions within the manifest that are used to write to external storage.
  4. Use the warning dialog box to require the user to provide permissions for data writes.

Question 13

When getting data from Internet sources, which of the following do we need to stick to?

  1. Use a service class to get the data.
  2. Use a separate process instead of using user interface processes for data acquisition.
  3. Get data within a method in the main activity class.
  4. Save the retrieved data in the SQLite database.

Question FOURtee

Which of the following statements is incorrect?

  1. Even after the activeity that starts a service stops running, the service will continue to run.
  2. Activity will always be running unless the user exits with the back button.
  3. A binding service will also stop running together after any of the components bound to it have stopped running.
  4. When an activity's pointing changes, it is recreated by default.

Question fifteen

To enable another activity in one activity, which of the following classes do we need to use?

  1. Intent
  2. Thread
  3. View
  4. Service

Question sixteen

Which of the following callback methods does not execute when an application starts and is in the resumed state?

  1. onCreate
  2. onPause
  3. onStart
  4. onResume

Question 17

Which of the following callback methods will be implemented when the user returns to our application after a pause?

  1. onRestart
  2. onResume
  3. onStart
  4. onCreate

Question 18

Do we need to use the current method to store state data in the onCreate and onRestore Instate methods of activeity for future access?

  1. onDestroy
  2. onSaveInstanceState
  3. onStateChange
  4. onSaveState

Question 19

Which class allows us to define reusable user interface sections?

  1. Fragment
  2. Service
  3. Activity
  4. View

Question 20

Which of the following steps do we not need to take when releasing an app to Google Play?

  1. Include the version and name of the application in the manifest.
  2. APK signature with release key.
  3. Select content ratings and product pricing for your application.
  4. Create a video introduction for your application.

Correct answer:

1-5、CCDAC;

6-10、ADCDA;

11-15、CDBBA;

16-20、BBBAD。