Saturday, August 5, 2017

Preguntas respuestas Android 3

1. If your application requires to represent structured data, which of the following methods you should use to save data?
SharedPreferences
SQL Databases
File System

2. Which of the following methods are used to read from SharedPreferences:
readInt() and readString()
getInt() and writeString()
getInt() and getString() 

3 If you need just one shared preferences file for your activity, which method you should use?
context.getSharedPreferences
getActivity().getSinglePreference
getActivity().getPreferences 

4. How can you acquire the appropriate directory of your application if you want to save a file to internal storage ?
getFiles() or geInternalDir()
getInternalStorage() or getInternalDir()
getFilesDir() or getCacheDir() 

5. Which of the following provides a key-value system to read and write small collection of data:
SQL Database
Shared Preferences 
ArrayList

6. Which of the following methods are used to write to SharedPreferences:
putInt() and putString() 
putInt() and writeString()
writeInt() and writeString()

7. Since external storage could be unavailable, which method can query the external storage state ?
queryStorageState()
getExternalStorageState() 
getStorageState()

8. How can you check the available space without causing an IOException?
getFreeSpace() or getTotalSpace() 
getFreeSpace()
checkFreeSpace() or checkTotalSpace()

9. Which method you should use to read data from a data base?
query()
readFromDB()
read()

10. What is a contract class if we are talking about data bases ?
Is a container for string constants
Is a class that contains the permissions for a data base
Is a container for constants that define names for URIs, tables, and columns 


No comments:

Post a Comment