• Home
  • Ask a Question
  • About
  • Contact
  • Advertise
  • Sitemap
MENU

Android MCQ

Android Questions | Multiple Choice | Questions and Answers | Test Bank

  • Home
  • Translate
Archive for October 2017

The SharedPreferences class provides one of the easiest ways to save and load data. Which specific data type does this refer to?

The SharedPreferences class provides one of the easiest ways to save and load data. Which specific data type does this refer to?



Answer: primitive data

The following permissions are necessary in the Android Manifest file to use which type of storage?

The following permissions are necessary in the Android Manifest file to use which type of storage?



Answer: external

If data is lost when an app or the device stops running where was the data stored?

If data is lost when an app or the device stops running where was the data stored?



Answer: RAM

If you have a large amount of data to store as persistent data, which of the following storage methods would be most efficient?

If you have a large amount of data to store as persistent data, which of the following storage methods would be most efficient?



Answer: database

All applications can read and write files placed on external storage. T/F

All applications can read and write files placed on external storage. T/F



Answer: True

Persistent data stores values permanently by placing the information in a file. T/F

Persistent data stores values permanently by placing the information in a file. T/F



Answer: True

What is the maximum number of shared preferences you can create?

What is the maximum number of shared preferences you can create?



Answer: unlimited

Which type of file does the SharedPreferences object save data to?

Which type of file does the SharedPreferences object save data to?



Answer: XML

The persistent data structure is available in some form in every programming language. T/F

The persistent data structure is available in some form in every programming language. T/F



Answer: True

SharedPreferences can be used to save only int and string primitive data. T/F

SharedPreferences can be used to save only int and string primitive data. T/F



Answer: False

Which data type is NOT supported by the SharedPreferences class?

Which data type is NOT supported by the SharedPreferences class?



Answer: char

Android applications cannot save data for later retrieval if the application is closed. T/F

Android applications cannot save data for later retrieval if the application is closed. T/F



Answer: False

Which of the following correctly completes the statement below to instantiate a SharedPreferences object?

Which of the following correctly completes the statement below to instantiate a SharedPreferences object?



Answer:

SharedPreferences sharedPref =
PreferenceManager.getDefaultSharedPreferences(this);

An undefined string value is set to a(n) ____________ value, which is represented by empty quotes.

An undefined string value is set to a(n) ____________ value, which is represented by empty quotes.




Answer: null

With Android, you have the option of storing persistent data only on the device's internal storage. T/F

With Android, you have the option of storing persistent data only on the device's internal storage. T/F



Answer: False

Which statement dynamically assigns an image named car in the drawable folder to an ImageView control?

Which statement dynamically assigns an image named car in the drawable folder to an ImageView control?



Answer: image.setImageResource(R.drawable.car);

The code to create an instance of a SharedPreferences editor object named edit is ________.

The code to create an instance of a SharedPreferences editor object named edit is ________.




Answer: SharedPreferences.Editor edit = sharedPref.edit();

If a string value is undefined in a key's value, what is it set to?

If a string value is undefined in a key's value, what is it set to?



Answer: null

Which method is used to store integer data in a SharedPreferences object?

Which method is used to store integer data in a SharedPreferences object?



Answer: putInt()

The persistent _______ structure is available in some form in every programming language.

The persistent _______ structure is available in some form in every programming language.



Answer: data

Data stored in _____ is lost when the app (or the device) stops running.

Data stored in _____ is lost when the app (or the device) stops running.



Answer: RAM

When you write data using SharedPreferences, with which SharedPreferences object can you make changes?

When you write data using SharedPreferences, with which SharedPreferences object can you make changes?



Answer: SharedPreferences Editor

The code to store the string "Hello" into a key named "greeting" using a SharedPreferences editor object named edit is _______.

The code to store the string "Hello" into a key named "greeting" using a SharedPreferences editor object named edit is _______.



Answer: ...

The _____ stores structured data in a private database.

The _____ stores structured data in a private database.



Answer: SQLite database

If a numeric value is undefined in a key's value, what is it set to?

If a numeric value is undefined in a key's value, what is it set to?



Answer: 0

Which type of storage is used if data is saved to an SD card?

Which type of storage is used if data is saved to an SD card?



Answer: External

The ____ method retrieves string values.

The ____ method retrieves string values.



Answer: getString()

What's the first step when writing persistent data using a SharedPreferences file?

What's the first step when writing persistent data using a SharedPreferences file?



Answer: Obtain an instance of the SharedPreferences file

The _______ method retrieves long values.

The _______ method retrieves long values.



Answer: getLong()

The code to assign a key-value pair for a floating point value with keyname interest and variable name fltInterest using a SharedPreferences editor object named edit is _______.

The code to assign a key-value pair for a floating point value with keyname interest and variable name fltInterest using a SharedPreferences editor object named edit is _______.




Answer: ...

After the app is terminated, what happens to the data stored within the SQLite database?

After the app is terminated, what happens to the data stored within the SQLite database?



Answer: It persists

The name-value pair in a SharedPreferences object is saved to a(n) ______ file that can be retrieved later in the app or after the app closes.

The name-value pair in a SharedPreferences object is saved to a(n) ______ file that can be retrieved later in the app or after the app closes.



Answer: XML

A(n) _________ stores persistent data on a web server.

A(n) _________ stores persistent data on a web server.



Answer: Network connection

What does the abbreviation SQL stand for?

What does the abbreviation SQL stand for?



Answer: Structured Query Language

Which method is used to retrieve a Boolean value from a SharedPreferences object?

Which method is used to retrieve a Boolean value from a SharedPreferences object?



Answer: getBoolean()

Before an app attempts to connect to a network connection, what action should be taken?

Before an app attempts to connect to a network connection, what action should be taken?



Answer: The app should see if an Internet connection is available.

The SharedPreferences class stores private data as single values. T/F

The SharedPreferences class stores private data as single values. T/F



Answer: False

____ stores values permanently by placing the information in a file.

____ stores values permanently by placing the information in a file.



Answer: Persistent data

SharedPreferences are best when your app needs to save small chunks of data. T/F

SharedPreferences are best when your app needs to save small chunks of data. T/F



Answer: True

_____ stores data, which can be available to other apps on shared external storage.

_____ stores data, which can be available to other apps on shared external storage.



Answer: External storage

How does the Shared preferences option of storing persistent data store private data?

How does the Shared preferences option of storing persistent data store private data?



Answer: key-value pairs

In a key-value pair, what is the key that uniquely identifies the preference?

In a key-value pair, what is the key that uniquely identifies the preference?



Answer: string

In an Android project, an ImageView control can display an image by assigning what in the XML layout file?

In an Android project, an ImageView control can display an image by assigning what in the XML layout file?



Answer: source path

To write key-value pair assignments to an XML data file using a SharedPreferences editor object named edit, type ____________________.

To write key-value pair assignments to an XML data file using a SharedPreferences editor object named edit, type ____________________.




...

For Shared Preferences methods, what does the method return to the application if the preference is undefined?

For Shared Preferences methods, what does the method return to the application if the preference is undefined?



Answer: default value

Which Android tool can store data that can be used in different Activities of your application or by another application?

Which Android tool can store data that can be used in different Activities of your application or by another application?



Answer: SharedPreferences

A SharedPreferences object is used to store user data only as long as the application is open. T/F

A SharedPreferences object is used to store user data only as long as the application is open. T/F



Answer: False

All applications on a device can access any files created by an app when they are saved with the internal storage method. T/F

All applications on a device can access any files created by an app when they are saved with the internal storage method. T/F



Answer: False

Loading data saved in a SharedPreferences XML file begins by _______________ the SharedPreferences object.

Loading data saved in a SharedPreferences XML file begins by _____ the SharedPreferences object.



Answer: instantiating

What is one of the most effective ways to save simple application data to an Android device?

What is one of the most effective ways to save simple application data to an Android device?



Answer: SharedPreferences object

____ can downgrade a database.

____ can downgrade a database.



Answer: onDowngrade

DatabaseOpenHelper's _______ will be called to upgrade the database to the newest version.

DatabaseOpenHelper's _______ will be called to upgrade the database to the newest version.



Answer: onUpgrade

The SQLiteDatabase's query method returns a cursor containing the _______ .

The SQLiteDatabase's query method returns a cursor containing the _______ .



Answer: Result-set

SQLite doesn't support inserting an empty row.

SQLite doesn't support inserting an empty row.



Answer: True

A database will be cached by an os to improve performance.

A database will be cached by an os to improve performance.



Answer: True

Database names don't have to be unique across apps.

Database names don't have to be unique across apps.



Answer: False

Android doesn't automatically release database resources.

Android doesn't automatically release database resources.



Answer: True

Class cursor provides a method _______ if you prefer to get an exception when the specified column DNE.

Class cursor provides a method _______ if you prefer to get an exception when the specified column DNE.



Answer: getColumnIndexOrThrow

It's considered best practice to ensure _______ returns true before attempting to get data from the database object.

It's considered best practice to ensure _______ returns true before attempting to get data from the database object.



Answer: moveToFirst

Cursor method _______ moves the cursor to the first row of the result set.

Cursor method _______ moves the cursor to the first row of the result set.



Answer: moveToFirst

Method _______ uses the MenuItem's resourceID to determine which one was selected.

Method _______ uses the MenuItem's resourceID to determine which one was selected.



Answer: onOptionsItemSelected

Use the CursorAdapter method _______ to remove the cursor.

Use the CursorAdapter method _______ to remove the cursor.



Answer: changeCursor(true)

______ is called after onPause when the Fragment is no longer visible.

______ is called after onPause when the Fragment is no longer visible.



Answer: onStop

AsyncTask's execute method _______ performs the task in a separate thread.

AsyncTask's execute method _______ performs the task in a separate thread.



Answer: doInBackground

An AsyncTask can only be executed ___ time(s).

An AsyncTask can only be executed ___ time(s).



Answer: 1

You call inherited ListActivity method _______ to bind a ListView to a cursor to display the data.

You call inherited ListActivity method _______ to bind a ListView to a cursor to display the data.



Answer: setListAdapter

You cannot use custom layout resources for ListView items.

You cannot use custom layout resources for ListView items.



Answer: False

_____ is a subclass of CursorAdapter designed to simplify mapping of cursor columns directly to TextViews and ImageViews.

_____ is a subclass of CursorAdapter designed to simplify mapping of cursor columns directly to TextViews and ImageViews.



Answer: SimpleCursorAdapter

To display the Cursor's results in a ListView we create a new _______ to expose the cursor's data in a manner that can be used by a ListView.

To display the Cursor's results in a ListView we create a new _______ to expose the cursor's data in a manner that can be used by a ListView.



Answer: CursorAdapter

You call ListView method _______ to determine how many items can be selected.

You call ListView method _______ to determine how many items can be selected.



Answer: setChoiceMode

You call Fragment method _______ to indicate that the list fragment should be retained rather than created.

You call Fragment method _______ to indicate that the list fragment should be retained rather than created.



Answer: setRetainedInstance(true)

_____ pushes a Fragment onto the back stack so that if the user pushes the back button it will pop that Fragment back.

_____ pushes a Fragment onto the back stack so that if the user pushes the back button it will pop that Fragment back.



Answer: addToBackstack

You can pass arguments to a fragment by placing them in a _______ of key-value pairs.

You can pass arguments to a fragment by placing them in a _______ of key-value pairs.



Answer: Bundle

FragmentManager's _______ method removes the top fragment of a Fragment back stack.

FragmentManager's _______ method removes the top fragment of a Fragment back stack.



Answer: popBackStack

If the resource ID _______ exists in MainActivity's layout, then the app is running on a phone.

If the resource ID _______ exists in MainActivity's layout, then the app is running on a phone.



Answer: R.id.FragmentContainer

You can configure a Fragment to be retained across configuration changes, such as when the user rotates the device.

You can configure a Fragment to be retained across configuration changes, such as when the user rotates the device.




Answer: true

Class MainActivity manages the app's fragments and coordinates the interactions between them. On phones, MainActivity display one master Fragment and one detail Fragment at a time.

Class MainActivity manages the app's fragments and coordinates the interactions between them. On phones, MainActivity display one master Fragment and one detail Fragment at a time.



Answer: False

Each menu item's order in category values determine the order in which the menu items appear on the action bar.

Each menu item's order in category values determine the order in which the menu items appear on the action bar.



Answer: true

textPostalAddress|_______ capitalizes state abbreviations.

textPostalAddress|_______ capitalizes state abbreviations.



Answer: textCapCharacters

Each _______ specifies input type and IME options. For devices with a soft keyboard, the _______ specifies which keyboard to display.

Each _______ specifies input type and IME options. For devices with a soft keyboard, the _______ specifies which keyboard to display.



Answer: EditText, InputType

A _______ is a ViewGroup that lets the user scroll through the content too large to display on the screen.

A _______ is a ViewGroup that lets the user scroll through the content too large to display on the screen.



Answer: ScrollView

Style resources are placed in the app's _______ folder.

Style resources are placed in the app's _______ folder.




Answer: Res/values

We use _______ to perform operations in one thread and receive the results in the GUI thread.

We use _______ to perform operations in one thread and receive the results in the GUI thread.



Answer: AsyncTasks

Long-running operations should be placed outside the _______ .

Long-running operations should be placed outside the _______ .



Answer: GUI Thread

The _______ simplifies creating the database and enables you to get a SQLiteDatabase object for manipulating a database's content.

The _______ simplifies creating the database and enables you to get a SQLiteDatabase object for manipulating a database's content.



Answer: SQLiteOpenHelper

SQL Query results are managed with a _______ .

SQL Query results are managed with a _______ .



Answer: Cursor

You can use a _______ or ArrayAdapter to display results in a ListView.

You can use a _______ or ArrayAdapter to display results in a ListView.



Answer: CursorAdapter

A ListFragment uses a _______ as its default layout.

A ListFragment uses a _______ as its default layout.



Answer: ListView

When a fragment's primary task is to display a scrollable list of items, you can extend class _______ .

When a fragment's primary task is to display a scrollable list of items, you can extend class _______ .



Answer: ListFragment

By default, TextViews have a border.

By default, TextViews have a border.



Answer: False

You can apply styles to all components by using the _______ attribute.

You can apply styles to all components by using the _______ attribute.



Answer: style

You can define common GUI component attribute-value pairs as _______ .

You can define common GUI component attribute-value pairs as _______ .



Answer: style resources

When an app is placed in the background, the app's GUI components don't get saved.

When an app is placed in the background, the app's GUI components don't get saved.


Answer: False

_____ is called by the system when the configuration of the device changes during the app's execution.

_____ is called by the system when the configuration of the device changes during the app's execution.



Answer: onSaveInstanceState

Each Fragment defines an interface of _______ that are implemented in the host Activity.

Each Fragment defines an interface of _______ that are implemented in the host Activity.



Answer: Callback methods

To communicate data between Fragments, use the host ________.

To communicate data between Fragments, use the host ________.



Answer: Activity

Use FragmentManager and _______ to dynamically display fragments.

Use FragmentManager and _______ to dynamically display fragments.




Answer: FragmentTransactions

Use Android's _______ - a data structure that stores Fragments in LIFO order.

Use Android's _______ - a data structure that stores Fragments in LIFO order.



Answer: Backstack

An app can use multiple activities to host an app's Fragments on a phone device.

An app can use multiple activities to host an app's Fragments on a phone device.



Answer: True

You can declare each Fragment in an Activity's layout or, for a DialogFragment, call its show method to create it.

You can declare each Fragment in an Activity's layout or, for a DialogFragment, call its show method to create it.



Answer: True
Subscribe to: Comments (Atom)

Search your questions here...

Trending Questions

  • Which of the following is appropriate for saving the state of an Android application?
    Which of the following is appropriate for saving the state of an Android application? A. Activity.onDestroy() B. Activity.onStop() C....
  • For creating Fragments the java class needs to extend which base class?
    For creating Fragments the java class needs to extend which base class? A) MainActivity B) MiniActivity C) Fragment D) None of th...
  • Which of the following statements is correct?
    Which of the following statements is correct? A) Permissions are not specified in AndroidManifest.xml. B) The AndroidManifest.xml is ...

Blog Archive

  • October 2020 (68)
  • December 2019 (83)
  • May 2019 (151)
  • November 2018 (146)
  • October 2018 (125)
  • June 2018 (93)
  • November 2017 (77)
  • October 2017 (100)
  • September 2017 (82)

Label

Android Android App Development Chapter 8 Android Apps Chapter 11 Android Apps Chapter 16 Android Chapter 14 Android Chapter 15 Does Android support the Bluetooth serial port profile? Mobile App
Powered by Blogger.
Copyright © 2015 Android MCQ | Term Of Service | Disclaimer | Privacy Policy | DMCA