ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 96 - Associate Android Developer discussion

Report
Export

Assume that you have the following situation:

The app code calls for R.string.text_a

Three relevant resource files are available:

- res/values/strings.xml, which includes text_a in the app's default language, in this case English.

- res/values-mcc404/strings.xml, which includes text_a in the app's default language, in this case English.

- res/values-hi/strings.xml, which includes text_a in Hindi.

The app is running on a device that has the following configuration:

- The SIM card is connected to a mobile network in India (MCC 404).

- The language is set to Hindi (hi).

Which is the correct statement below?

A.
Android loads text_a from res/values/strings.xml (in English)
Answers
A.
Android loads text_a from res/values/strings.xml (in English)
B.
Android loads text_a from res/values-mcc404/strings.xml (in English)
Answers
B.
Android loads text_a from res/values-mcc404/strings.xml (in English)
C.
Android loads text_a from res/values-hi/strings.xml (in Hindi)
Answers
C.
Android loads text_a from res/values-hi/strings.xml (in Hindi)
Suggested answer: B

Explanation:

Android loads text_a from res/values-mcc404/strings.xml (in English), even if the device is configured for Hindi. That is because in the resource-selection process,

Android prefers an MCC match over a language match (as a priority Exception).

Reference:

https://developer.android.com/guide/topics/resources/localization

asked 18/09/2024
Pedro Miguel Garcia Valdes
43 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first