โ† All Android Development Flashcard Decks

Android Development Flashcards

7 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 7 Android Development flashcards as text
  1. An app crashes with a NetworkOnMainThreadException. What is the correct fix?

    Answer: Move the network call to a background thread or coroutine

    Android forbids network I/O on the main thread, so the call must run on a background dispatcher such as Dispatchers.IO.

  2. In Kotlin coroutines, which dispatcher is optimized for disk and network operations?

    Answer: Dispatchers.IO

    Dispatchers.IO maintains a larger thread pool tuned for blocking I/O like file and network access.

  3. Why does ViewModel survive configuration changes such as screen rotation?

    Answer: It is retained in a ViewModelStore that outlives the Activity recreation

    The ViewModelStore is kept across configuration changes, so the same ViewModel instance is handed to the recreated Activity.

  4. Which RecyclerView optimization avoids redrawing the entire list when only some items change?

    Answer: Using DiffUtil (e.g. via ListAdapter) to dispatch minimal updates

    DiffUtil computes the difference between old and new lists and dispatches only the necessary item-level updates.

  5. Starting with Android 6.0 (API 23), how must dangerous permissions like CAMERA be obtained?

    Answer: Requested at runtime in addition to being declared in the manifest

    Dangerous permissions require both a manifest declaration and an explicit runtime request that the user can deny.

  6. What is the role of an Intent filter declared on an Activity?

    Answer: It advertises which implicit intents the Activity can handle

    Intent filters let the system match implicit intents, such as viewing a URL, to Activities that declare they can handle them.

  7. In a Room database, what does the @Query annotation on a DAO method do?

    Answer: Binds a compile-time verified SQL statement to the method

    @Query attaches an SQL statement that Room validates at compile time against the schema.