Deck 11: Discover Persistent Data

Full screen (f)
exit full mode
Question
With Android, yo u have th e option of storing persist e nt data only on the device's internal storage.
Use Space or
up arrow
down arrow
to flip the card.
Question
All applications can read and write files placed on external storage.
Question
A fter the app is terminated, what happens to the data stored within the SQLite database?

A) It erases.
B) It pauses .
C) It is transfer red to another location.
D) I t persists.
Question
When you write data using SharedPreferences, with which SharedPreferences object can you make changes?

A) SharedPreferences Manager
B) SharedPreferences Editor
C) SharedPreferences Memory
D) SharedPreferences Status
Question
Before an app attempts to connect to a netwo rk connection, what action should be taken?

A) The app should scan the quality of the network.
B) The app should open a network's web browser.
C) The app should see if an Internet connection is available.
D) No action needs to be taken.
Question
A SharedPreferences object is used to store user data only as long as the application is open.
Question
Which Android tool can store data that can be used in different Activities of your application or by another application ?

A) KeyTool
B) ListPreferences
C) ListSave
D) SharedPreferences
Question
What does the abbreviation SQL stand for?

A) Simple Quorum Language
B) Simpl e Query List
C) Structured Query Language
D) Structured Quorum List
Question
SharedPreferences can be used to save only int and string primitive data.
Question
What is one of the most effective ways to save simple application data to an Android device?

A) internal storgage
B) SharedPreferences object
C) external storage
D) SQLite database
Question
SharedPreferences are best when your app needs to save small chunks of data.
Question
The persistent data structure is available in some form in every programming language. 
Question
Persistent data stores values permanently by placing the information in a file.
Question
The SharedPreferences class stores private data as single values.
Question
T he Shared Preferences class provides one of the easiest ways to sav e and load data. Which specific data type does this refer to ?

A) encrypted data
B) persistent data
C) application data
D) primitive data
Question
Android applications cannot save data for later retrieval if the application is closed .
Question
All applications on a device can access any files created by an app when they are saved with the internal storage method.
Question
In a key-value pair, what is the key that uniquely identifies the preference ?

A) int
B) string
C) float
D) Boolean
Question
If you have a large amount of data to store as persistent data, which of the following storag e methods would be most efficient?

A) database
B) the device's internal storage
C) SD card
D) network connection
Question
How does the Shared preferences option of storing persistent data store private data?

A) private database
B) shared external storage
C) public cloud
D) key-value pairs
Question
If a string value is undefined in a key's value, what is it set to ?

A) *
B) the number 0
C) null
D) " "
Question
Which of the following correctly completes the statement b elow to instantiate a Shared Preferences object?
SharedPreferences sharedPref =

A) PreferenceManager.getDefaultSharedPreferences(this);
B) SharedPreferences.getDefault PreferenceManager (this);
C) PreferenceManager. SharedPreferences .getDefault(this);
D) SharedPreferences . PreferenceManager .getDefault(this);
Question
Which type of file does t he SharedPreferences object save data to?

A) SRC
B) RES
C) XML
D) DAT
Question
The _____________________ stores structured data in a private database.
Question
Data stored in ____________________ is lost when the app (or the device) stops running.
Question
Which statement dynamically assigns an image named car in the drawable folder to an ImageView control?

A) car.setImageResource(R.drawable.image);
B) image.setImageResource(car.R.drawable);
C) image.setImageResource(R.drawable.car);
D) SetImageResource .image( R. drawable.car);
Question
What is t he maximum number of shared preferences you can create ?

A) less than 10
B) It's based on the number of apps.
C) unlimited
D) 25 or less
Question
________________________ stores data, which can be available to other apps on shared external storage.
Question
In an Android project, an ImageView control can display an image by assigning what in the XML layout file ?

A) source path
B) workspace
C) target grid
D) hashtag
Question
If a numeric value is undefined in a key's value, what is it set to?

A) undefined
B) null
C) 0
D) -1
Question
The following permissions are necessary in the Android Manifest file to use which type of storage?

A) internal
B) external
C) indexed
D) volatile
Question
_____________________ stores values permanently by placing the information in a file.
Question
What's the first step when writing persisten t data using a SharedPreferences file?

A) Save the values to the preferences file
B) Assign values into SharedPreferences objects
C) Create a SharedPreferences.Editor object
D) Obtain an instance of the SharedPrefe rences file
Question
The persistent ____________________ structu re is available in some form in every programming language.
Question
Which method is used to store integer data in a SharedPreferences object ?

A) place Int ()
B) saveInteger()
C) putInt()
D) storeInteger()
Question
If data is lost when an app or the device stops running w here was the data st ored?

A) a cloud service
B) RAM
C) the device's driver
D) a memory card
Question
For Shared Preferences methods, what does the metho d return to  the application if the preference is undefi ned?

A) error code
B) "undefined" string
C) -1
D) default value
Question
Which method is used to retrieve a Boolean value from a SharedPreferences object?

A) getBool()
B) getBoolean()
C) readBoolean()
D) readBool()
Question
Which d ata type is NOT supported by the SharedPreference s class?

A) long
B) char
C) float
D) string
Question
Which type of storage is used if data is saved to an SD card?

A) Internal
B) Shared preferences
C) External
D) Network connection
Question
To write key-value pair assignments to an XML data file using a SharedPreferences editor object named edit, type ____________________.
Question
A(n) _______________ stores persistent data on a web server.
Question
The code to create a n instance of a SharedPreferences editor object named edit is ______________________________.
Question
The ______________________ method retrieves string values.
Question
The code to store the string "Hello" into a key named " gree ting" using a SharedPreferences editor object named edit is ____________________________.
Question
The code to assign a key-value pair for a floating point value with keyname interest and variable name fl t Inter est using a SharedPreferences editor object named edit is ___________________________________.
Question
An undefined string value is set to a(n) ____________ value, which is represented by empty quotes. 
Question
Loading data saved in a SharedPreferences XML file begins by _______________ the SharedPreferences object.
Question
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.
Question
The ______________________ method retrieves long values.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 11: Discover Persistent Data
1
With Android, yo u have th e option of storing persist e nt data only on the device's internal storage.
False
2
All applications can read and write files placed on external storage.
True
3
A fter the app is terminated, what happens to the data stored within the SQLite database?

A) It erases.
B) It pauses .
C) It is transfer red to another location.
D) I t persists.
D
4
When you write data using SharedPreferences, with which SharedPreferences object can you make changes?

A) SharedPreferences Manager
B) SharedPreferences Editor
C) SharedPreferences Memory
D) SharedPreferences Status
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
Before an app attempts to connect to a netwo rk connection, what action should be taken?

A) The app should scan the quality of the network.
B) The app should open a network's web browser.
C) The app should see if an Internet connection is available.
D) No action needs to be taken.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
A SharedPreferences object is used to store user data only as long as the application is open.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
Which Android tool can store data that can be used in different Activities of your application or by another application ?

A) KeyTool
B) ListPreferences
C) ListSave
D) SharedPreferences
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
What does the abbreviation SQL stand for?

A) Simple Quorum Language
B) Simpl e Query List
C) Structured Query Language
D) Structured Quorum List
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
SharedPreferences can be used to save only int and string primitive data.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
What is one of the most effective ways to save simple application data to an Android device?

A) internal storgage
B) SharedPreferences object
C) external storage
D) SQLite database
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
SharedPreferences are best when your app needs to save small chunks of data.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
The persistent data structure is available in some form in every programming language. 
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
Persistent data stores values permanently by placing the information in a file.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
The SharedPreferences class stores private data as single values.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
T he Shared Preferences class provides one of the easiest ways to sav e and load data. Which specific data type does this refer to ?

A) encrypted data
B) persistent data
C) application data
D) primitive data
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
Android applications cannot save data for later retrieval if the application is closed .
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
All applications on a device can access any files created by an app when they are saved with the internal storage method.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
In a key-value pair, what is the key that uniquely identifies the preference ?

A) int
B) string
C) float
D) Boolean
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
If you have a large amount of data to store as persistent data, which of the following storag e methods would be most efficient?

A) database
B) the device's internal storage
C) SD card
D) network connection
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
How does the Shared preferences option of storing persistent data store private data?

A) private database
B) shared external storage
C) public cloud
D) key-value pairs
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
If a string value is undefined in a key's value, what is it set to ?

A) *
B) the number 0
C) null
D) " "
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
Which of the following correctly completes the statement b elow to instantiate a Shared Preferences object?
SharedPreferences sharedPref =

A) PreferenceManager.getDefaultSharedPreferences(this);
B) SharedPreferences.getDefault PreferenceManager (this);
C) PreferenceManager. SharedPreferences .getDefault(this);
D) SharedPreferences . PreferenceManager .getDefault(this);
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
Which type of file does t he SharedPreferences object save data to?

A) SRC
B) RES
C) XML
D) DAT
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
The _____________________ stores structured data in a private database.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
Data stored in ____________________ is lost when the app (or the device) stops running.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
Which statement dynamically assigns an image named car in the drawable folder to an ImageView control?

A) car.setImageResource(R.drawable.image);
B) image.setImageResource(car.R.drawable);
C) image.setImageResource(R.drawable.car);
D) SetImageResource .image( R. drawable.car);
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
What is t he maximum number of shared preferences you can create ?

A) less than 10
B) It's based on the number of apps.
C) unlimited
D) 25 or less
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
________________________ stores data, which can be available to other apps on shared external storage.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
In an Android project, an ImageView control can display an image by assigning what in the XML layout file ?

A) source path
B) workspace
C) target grid
D) hashtag
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
If a numeric value is undefined in a key's value, what is it set to?

A) undefined
B) null
C) 0
D) -1
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
The following permissions are necessary in the Android Manifest file to use which type of storage?

A) internal
B) external
C) indexed
D) volatile
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
_____________________ stores values permanently by placing the information in a file.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
What's the first step when writing persisten t data using a SharedPreferences file?

A) Save the values to the preferences file
B) Assign values into SharedPreferences objects
C) Create a SharedPreferences.Editor object
D) Obtain an instance of the SharedPrefe rences file
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
The persistent ____________________ structu re is available in some form in every programming language.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
Which method is used to store integer data in a SharedPreferences object ?

A) place Int ()
B) saveInteger()
C) putInt()
D) storeInteger()
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
If data is lost when an app or the device stops running w here was the data st ored?

A) a cloud service
B) RAM
C) the device's driver
D) a memory card
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
For Shared Preferences methods, what does the metho d return to  the application if the preference is undefi ned?

A) error code
B) "undefined" string
C) -1
D) default value
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
Which method is used to retrieve a Boolean value from a SharedPreferences object?

A) getBool()
B) getBoolean()
C) readBoolean()
D) readBool()
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
Which d ata type is NOT supported by the SharedPreference s class?

A) long
B) char
C) float
D) string
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
Which type of storage is used if data is saved to an SD card?

A) Internal
B) Shared preferences
C) External
D) Network connection
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
To write key-value pair assignments to an XML data file using a SharedPreferences editor object named edit, type ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
A(n) _______________ stores persistent data on a web server.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
The code to create a n instance of a SharedPreferences editor object named edit is ______________________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
The ______________________ method retrieves string values.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
The code to store the string "Hello" into a key named " gree ting" using a SharedPreferences editor object named edit is ____________________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
The code to assign a key-value pair for a floating point value with keyname interest and variable name fl t Inter est using a SharedPreferences editor object named edit is ___________________________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
An undefined string value is set to a(n) ____________ value, which is represented by empty quotes. 
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
Loading data saved in a SharedPreferences XML file begins by _______________ the SharedPreferences object.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
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.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
The ______________________ method retrieves long values.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 50 flashcards in this deck.