We read your photo as:

What is the purpose of XML files in Android development?

Computer Science

ScanSolve AI Answer

Answer

B

Step-by-step solution

2 steps
  1. Analyze the options for the purpose of XML files in Android development.

    Option 1: To store user data and preferences.
    SharedPreferences uses XML internally for storage, but developers do not write XML files to store data.

    Option 2: To design user interface and layout elements.
    XML files (e.g., \texttt{activity_main.xml}) define UI layouts with views like \texttt{TextView}, \texttt{Button}, and layouts like \texttt{LinearLayout}.

    Option 3: To compile Kotlin code.
    Kotlin code is compiled using the Kotlin compiler (\texttt{kotlinc}) and Gradle build system.

  2. Identify the primary purpose.

    XML is used to declaratively design the user interface and layout elements.

    B

Was this helpful?

Try one yourself

A new problem that tests the same skill.

Still stuck on this one?

Ask a follow-up, and the answer starts from this question.

Got a different question?Ask your own question