android linkedin assessment answers
4. Different languages have different rules for grammatical agreement with quantity. To support the following two strings in multiple languages in your app, what is the ideal resource definition?
"You have 1 day remaining"
"You have 2 days remaining"
5. Given the string resource below, which code snippet is valid?
‹string name="upload photo notification">1Sd of &2sd
photos uploaded
6. What is not a use case for idling resources in your Espresso tests?
- managing system services
- loading data from the internet or a local data source
- performing bitmap transformations
- processing user input events
7. Which approach is not recommended for providing a useful offline state in your app?
- always notifying users that connectivity has been lost
- caching data
- storing data locally
- queuing outbound requests to action when connectivity is restored
8. When would you use the ActivityCompat.shouldShowRequestPermissionRationale() function?
- when a user has previously denied the request for a given permission and selected “Don’t ask again,” but you need the permission for your app to function
- when a user has previously denied the request for a given permission and you want to provide an explanation for its use
- when a user has previously denied the request for a given permission and selects “Tell me more”
- when a user first opens your app and you want to provide an explanation for the use of a given permission
9. What is not a type of resource for providing your app with strings?
- text
- string-array
- string
- plurals
10. What is not a benefit of externalizing app resources such as images and strings from your code?
- It allows you to provide a different Ul experience based on the user’s device size.
- It allows you to provide a different Ul experience based on the user’s language settings.
- It allows you to have more performant applications because the code and resources are separated.
- It allows Android to choose the appropriate resource based on the current configuration during runtime.
11. You have built code to make a network call and tested that it works in your development environment. However, when you publish it to the Play console, the networking call fails to work. What will not help you troubleshoot this issue?
- using the profiler tools in Android Studio to detect anomalies in CPU, memory, and network usage
- checking that the network data transfer object has @SerializedName applied to its member properties
- checking for exceptions in the server logs or server console
- checking whether ProGuard-keepclassmembers have been added to the network data transfer obiects (DOs) in question
12. What is the chief purpose of line five in this code snippet?
- to prevent the display of two fragments side by side in cases where the activity is restored from a previous state
- to make sure that the activity creates a new fragment each time it is restored from a previous state
- to prevent the creation of overlapping fragments in cases where the activity is restored from a previous state
- to make sure that the activity finishes when the savedInstanceState is not null
13. Which definition will prevent other apps from accessing your Activity class via an intent?
14. You would like to enable analytics tracking only in release builds. How can you create a new field in the generated Buildconfig class to store that value?
15. You need to upgrade to the latest version of the Android Gradle plugin Which file should you modify?
- root project dir/settings.gradle
- root project dir/app/gradle.properties
- root project dir/app/build.gradle
- root project dir/build.gradle