Build-A-Bot: Android Java Quiz for Curious Kids

Test your Android Java smarts with fun questions about apps, code, and gadgets—perfect for curious 12+ minds ready to explore mobile magic!

  1. Which class is the typical entry point for an Android app screen?
    1. BroadcastReceiver
    2. Service
    3. Activity
    4. Fragment
  2. Which file defines an Android app's package name and version?
    1. AndroidManifest
    2. build.gradle
    3. strings.xml
    4. MainActivity.java
  3. Which layout type arranges children relative to each other or parent edges (legacy but still used)?
    1. FrameLayout
    2. LinearLayout
    3. RelativeLayout
    4. ConstraintLayout
  4. Which Android component runs background tasks without a UI and can be stopped by the system?
    1. Activity
    2. Service
    3. ContentProvider
    4. BroadcastReceiver
  5. Which tool compiles Java/Kotlin and resources into an installable Android package?
    1. JUnit
    2. ProGuard
    3. ADB
    4. Gradle
  6. Which class helps store simple key-value app preferences?
    1. SharedPreferences
    2. SQLiteDatabase
    3. FileOutput
    4. ContentResolver
  7. Which permission is required to access the internet from an Android app?
    1. ACCESS_NETWORK
    2. INTERNET
    3. NETWORK_STATE
    4. ACCESS_WIFI

Answers and explanations

  1. Question: Which class is the typical entry point for an Android app screen?
    Answer: Activity
    Explanation: An Activity represents a single focused screen with a UI; fragments are reusable parts, not full entry points. It's where lifecycle methods like onCreate run.
  2. Question: Which file defines an Android app's package name and version?
    Answer: AndroidManifest
    Explanation: AndroidManifest.xml declares the package name and versionCode/name; build.gradle sets build settings but not the manifest-declared package identifier.
  3. Question: Which layout type arranges children relative to each other or parent edges (legacy but still used)?
    Answer: RelativeLayout
    Explanation: RelativeLayout positions views relative to siblings or parent edges; ConstraintLayout is newer and more flexible, while LinearLayout stacks views linearly.
  4. Question: Which Android component runs background tasks without a UI and can be stopped by the system?
    Answer: Service
    Explanation: Services run background work; they differ from WorkManager which schedules deferrable tasks, and from Threads which are not Android components.
  5. Question: Which tool compiles Java/Kotlin and resources into an installable Android package?
    Answer: Gradle
    Explanation: Gradle builds the app, invoking compilers and packagers to produce an APK/AAB; Android Studio uses Gradle under the hood, not just the Java compiler alone.
  6. Question: Which class helps store simple key-value app preferences?
    Answer: SharedPreferences
    Explanation: SharedPreferences is for lightweight key-value storage like settings; databases are for complex structured data and files for raw storage.
  7. Question: Which permission is required to access the internet from an Android app?
    Answer: INTERNET
    Explanation: The android.permission.INTERNET must be declared in the manifest to use network sockets; location or storage permissions do not grant network access.