โ† All Android Development Flashcard Decks

Android Data Storage Flashcards

6 cards from real Android Development practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 Android Data Storage flashcards as text
  1. Where does Android store internal app files that are accessible only to the app?

    Answer: getFilesDir()

    getFilesDir() returns the absolute path to the directory on the internal filesystem where app-private files are stored.

  2. What is the purpose of the ContentProvider in Android?

    Answer: To share data between apps using a standard interface

    ContentProvider allows an app to expose its data to other apps through a standardized URI-based interface.

  3. Which DataStore type stores typed objects using Protocol Buffers?

    Answer: Proto DataStore

    Proto DataStore stores data as typed Protocol Buffer objects, providing type safety and avoiding string keys used in Preferences DataStore.

  4. What happens to data in getCacheDir() when the device runs low on storage?

    Answer: The system may delete cache files automatically

    Files in the cache directory may be deleted by the system when storage is low, so apps should not rely on them for critical data.

  5. Which SQL clause is used in a Room @Query to filter results?

    Answer: WHERE

    The WHERE clause in Room SQL queries filters rows that meet a specified condition, just as in standard SQL.

  6. What is the recommended way to run Room database operations off the main thread?

    Answer: Using Kotlin coroutines with suspend functions

    Room supports Kotlin suspend functions in DAO interfaces, allowing database operations to run on background threads via coroutines.