AAD Data Management & Storage — Questions and Answers
Question 1: Which Android component is primarily used for managing structured data within an app?
- BroadcastReceiver
- Service
- ContentProvider (Correct answer)
- Activity
Correct answer: ContentProvider
A ContentProvider allows an app to manage and share structured data with other applications in a secure manner.
Question 2: Which class is used to store key-value pairs in Android?
- SQLiteDatabase
- SharedPreferences (Correct answer)
- FileOutputStream
- Intent
Correct answer: SharedPreferences
SharedPreferences is a lightweight storage option used to store small amounts of key-value data persistently.
Question 3: Which database system is commonly used in Android for local data storage?
- MySQL
- PostgreSQL
- SQLite (Correct answer)
- Firebase Firestore
Correct answer: SQLite
SQLite is an embedded database that allows Android applications to store and manage structured data efficiently.
Question 4: Which method is used to insert data into an SQLite database in Android?
- put()
- insert() (Correct answer)
- store()
- add()
Correct answer: insert()
The insert() method of the SQLiteDatabase class is used to add new records to a database table.
Question 5: Which cloud-based solution is commonly used for real-time database synchronization in Android apps?
- SQLite
- Room Database
- Firebase Realtime Database (Correct answer)
- MongoDB
Correct answer: Firebase Realtime Database
Firebase Realtime Database provides cloud-based real-time data synchronization across multiple devices.
Question 6: Which library simplifies working with SQLite in Android by providing an abstraction layer?
- SQLiteOpenHelper
- Room (Correct answer)
- Firestore
- LiveData
Correct answer: Room
Room is an Android Jetpack library that provides an abstraction layer over SQLite to enhance database operations and reduce boilerplate code.
Which Android component is primarily used for managing structured data within an app?