Android Mobile App Fundamentals Quiz

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.

  1. Android Components

    Which component is responsible for displaying a user interface screen in an Android application?

    1. Service
    2. Activity
    3. ContentProvider
    4. BroadcastReceiver

    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.

  2. Manifest File Purpose

    What is the primary purpose of the AndroidManifest.xml file in an Android application?

    1. Handles network requests
    2. Permits permission declarations and app components
    3. Stores images and layouts
    4. Manages user settings

    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.

  3. User Interface Layouts

    Which layout arranges its child views in a single vertical or horizontal row in Android?

    1. LinearLayout
    2. FrameLayout
    3. ConstraintLayout
    4. RelativeLayout

    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.

  4. Requesting Permissions

    If an Android app needs to access the device's camera, what should a developer do to request this access?

    1. Edit strings.xml
    2. Only add camera code to an Activity
    3. Declare the camera permission in the manifest
    4. Set a layout property

    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.

  5. App Resource Management

    Where should an Android developer store string values used for UI text to support localization?

    1. AndroidManifest.xml
    2. res/values/strings.xml
    3. drawable folder
    4. MainActivity.java

    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.