โ† All Android Development Flashcard Decks

Android UI and Layouts 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 UI and Layouts flashcards as text
  1. Which layout in Android arranges child views in a single row or column?

    Answer: LinearLayout

    LinearLayout arranges its child views sequentially in either a horizontal or vertical direction.

  2. What attribute is used to make a view occupy remaining space in a LinearLayout?

    Answer: layout_weight

    The layout_weight attribute distributes remaining space proportionally among views in a LinearLayout.

  3. Which view group is recommended for building flat, complex UI hierarchies in Android?

    Answer: ConstraintLayout

    ConstraintLayout allows you to create complex layouts with a flat view hierarchy, improving rendering performance.

  4. What is the purpose of the ViewBinding feature in Android?

    Answer: To generate binding classes for XML layouts eliminating findViewById

    ViewBinding generates a binding class for each XML layout file, providing type-safe references to all views with an ID.

  5. Which RecyclerView component is responsible for measuring and positioning item views?

    Answer: LayoutManager

    The LayoutManager in RecyclerView handles the layout strategy for its child views, such as linear, grid, or staggered arrangements.

  6. What method must be overridden to provide views in a RecyclerView.Adapter?

    Answer: onCreateViewHolder

    onCreateViewHolder is called when the RecyclerView needs a new ViewHolder to represent an item, inflating the item layout.

Android UI and Layouts Flashcards โ€” Android Development Study Cards with Answers