Discover the basics of developing mobile applications on Android, including core components, UI elements, system resources, and permissions. This quiz is designed to quickly assess key foundational knowledge required for beginner Android developers.
Which component is responsible for displaying a user interface screen in an Android application?
Explanation: An Activity is responsible for providing a user interface in Android. Services operate without a UI, BroadcastReceivers handle system-wide events, and ContentProviders manage app data sharing. Only Activity directly manages the user interface.
What is the primary purpose of the AndroidManifest.xml file in an Android application?
Explanation: The manifest file declares app permissions, components, and configuration. Network requests are coded elsewhere, user settings use SharedPreferences or databases, and images/layouts are stored in the res directory. Only the manifest governs app structure and permissions.
Which layout arranges its child views in a single vertical or horizontal row in Android?
Explanation: LinearLayout arranges its children sequentially in either a vertical or horizontal orientation. RelativeLayout positions elements relative to each other, FrameLayout stacks views, and ConstraintLayout allows complex positioning using constraints.
If an Android app needs to access the device's camera, what should a developer do to request this access?
Explanation: Declaring the camera permission in the manifest is essential so the system grants access. Layout properties, editing strings.xml, or just adding code do not request permissions from the system.
Where should an Android developer store string values used for UI text to support localization?
Explanation: Placing string values in res/values/strings.xml allows for efficient management and localization. The manifest is for app configuration, MainActivity.java is for logic, and the drawable folder is for images, not strings.