Android Development Practice Test — Questions and Answers
Question 1: What is the most recent Android smartphone version?
- 5.0 (Lollipop) (Correct answer)
- 3.0 (Honeycomb)
- 2.2(Froyo)
- 2.6
Correct answer: 5.0 (Lollipop)
Based on the provided options, Android 5.0 (Lollipop) was the most recent Android smartphone version among them at a certain point in time. Released in 2014, it introduced significant changes like Material Design, an updated notification system, and Project Volta for improved battery life. While newer versions exist today, Lollipop was the latest among the choices given.
Question 2: Which of these aren't included in Android's native libraries?
- OpenGL
- Webkit
- SQLite
- Dalvik (Correct answer)
Correct answer: Dalvik
Android's native libraries include essential components like OpenGL for graphics rendering, WebKit for web content display, and SQLite for local database management. Dalvik, however, is the virtual machine that executes Android applications, not a native library itself. It's a core part of the Android runtime environment, responsible for running the compiled app code.
Question 3: What is the activity's parent class?
- Activity Group
- ContextTheme Wrapper (Correct answer)
- Object
- Context
Correct answer: ContextTheme Wrapper
The `Activity` class in Android inherits from `ContextThemeWrapper`, which itself extends `Context`. This inheritance hierarchy provides the `Activity` with access to application resources, theming capabilities, and the ability to interact with the Android system. `ContextThemeWrapper` specifically adds the functionality to apply a theme to the context, which is crucial for an Activity's UI.
Question 4: What is Java bytecode compiled into while developing an Android app?
- Dalvik byte code (Correct answer)
- Java class files
- source code
- Java source code
Correct answer: Dalvik byte code
During Android app development, Java source code is first compiled into standard Java bytecode (.class files). This Java bytecode is then further processed by the Dex Compiler (historically `dx`, now `d8`) into Dalvik bytecode (.dex files). This Dalvik bytecode is optimized for the Android Runtime (ART) or the older Dalvik virtual machine, which executes the app on the device.
Question 5: Which of the following kernels is used by Android?
- Windows kernel
- Hybrid kernel
- Linux kernel (Correct answer)
- MAC kernel
Correct answer: Linux kernel
Android is built upon the robust foundation of the Linux kernel. The Linux kernel provides essential low-level system services such as memory management, process management, networking, and hardware device drivers. This choice leverages Linux's stability, security, and open-source nature, forming the core of the Android operating system.
Question 6: Which operating system serves as the Android stack's base?
- Java
- Linux (Correct answer)
- XML
- Windows
Correct answer: Linux
The Android software stack is architecturally layered, with the Linux kernel serving as its foundational base. This kernel provides crucial low-level services like process management, memory management, and device drivers, ensuring the operating system's stability and security. Building upon Linux allows Android to efficiently manage hardware resources and provide a robust environment for applications.
Question 7: Which of the following components an Intent doesn't activate?
- Content Provider (Correct answer)
- Broadcast Receiver
- Activity
- Services
Correct answer: Content Provider
Intents are messaging objects used to request an action from other application components, such as starting an Activity, a Service, or delivering a Broadcast. Content Providers, however, are activated and accessed differently; they are queried, inserted, updated, or deleted using a `ContentResolver` object, which interacts with the provider via URIs.
Question 8: What is the name of the Java bytecode to Dalvik bytecode converter program?
- Dex Compiler (Correct answer)
- Android Interpretive Compiler(AIC)
- Mobile Interpretive Compiler(MIC)
- Dalvik Converter
Correct answer: Dex Compiler
The program responsible for converting Java bytecode (.class files) into Dalvik bytecode (.dex files) is known as the Dex Compiler. Historically, this was the `dx` tool, but it has been largely replaced by `d8` in modern Android development. This conversion is a critical step, as Android's runtime (Dalvik or ART) executes the optimized Dalvik bytecode.
Question 9: After being installed on a device, each Android program is stored in a _______ .
- AIDL
- Messenger
- Binder (Correct answer)
- None of the above
Correct answer: Binder
After installation, each Android application runs in its own process, and inter-process communication (IPC) between these processes is facilitated by the Binder mechanism. The Binder is a high-performance IPC system that allows components from different applications to communicate securely and efficiently. It enables services to be called across process boundaries.
Question 10: Which of the three basic components of an.apk file is not one of these?
- Webkit (Correct answer)
- Dalvik Executable
- Resources
- Native Libraries
Correct answer: Webkit
An `.apk` (Android Package Kit) file is the package format for Android applications, containing all necessary components for installation. It typically includes the Dalvik Executable (.dex files), compiled resources (like layouts and strings), and native libraries (C/C++ code). WebKit is a browser engine that might be *used by* an app, but it's not a fundamental structural component *of* the `.apk` file itself.
Question 11: Which of the following languages is the basis for Android?
- C++
- JAVA (Correct answer)
- C
- VC++
Correct answer: JAVA
Android applications are primarily developed using the Java programming language. The Android SDK provides a comprehensive set of Java APIs for building mobile applications. While Kotlin has gained prominence as a first-class language for Android, Java remains a foundational language for the platform.
Question 12: You'll need an AVD to make an emulator. What exactly does it mean?
- Active Virtual Device
- Application Virtual Display
- Android Virtual Display
- Android Virtual Device (Correct answer)
Correct answer: Android Virtual Device
AVD stands for Android Virtual Device. It is a configuration that defines the characteristics of an Android phone, tablet, or other device that you want to simulate in the Android Emulator. An AVD specifies the Android version, hardware features, and screen size for the virtual device, allowing developers to test their apps on various configurations.
Question 13: Which of the following businesses purchased Android?
- Nokia
- Google (Correct answer)
- Apple
- None of the above
Correct answer: Google
Android Inc. was originally founded in 2003 by Andy Rubin, Rich Miner, Nick Sears, and Chris White. Google acquired Android Inc. in 2005, recognizing the potential of its mobile operating system. This acquisition was a pivotal moment that led to Android's development and eventual release as a dominant mobile platform.
Question 14: What does not have any UI components and runs in the background?
- Services (Correct answer)
- Applications
- Content Providers
- Intents
Correct answer: Services
A Service is an application component that can perform long-running operations in the background without providing a user interface. Services can continue to run even if the user switches to another application, making them suitable for tasks like playing music, performing network operations, or syncing data in the background.
Question 15: The method can be used to stop an activity.
- finishActivity()
- finish() (Correct answer)
- onDestory()
- None of the above
Correct answer: finish()
The `finish()` method is used to explicitly close the current Activity. When called, the system invokes the `onDestroy()` method of the Activity, and it is removed from the activity stack. This is the standard way to programmatically terminate an activity and remove it from the user's view.
Question 16: The Emulator simulates the operation of a genuine phone. Which feature of the game can't be simulated with an emulator?
- Applications
- Telephony
- The emulator can emulate/simulate all aspects of a smart phone.
- Sensors (Correct answer)
Correct answer: Sensors
While Android emulators are highly capable of simulating many aspects of a real device, including applications, telephony, and network connectivity, they typically cannot fully emulate hardware sensors. Physical sensors like accelerometers, gyroscopes, magnetometers, or light sensors require direct hardware interaction that software emulation cannot perfectly replicate.
Question 17: Is Android ROM available?
- A) no (Correct answer)
- B) yes
Correct answer: A) no
Android ROM, in the context of custom firmware, refers to a modified version of the Android operating system. However, Android itself is not a ROM (Read-Only Memory) in the traditional hardware sense. It is a software operating system that is installed onto a device's flash memory, which is rewritable, allowing for updates and modifications.
Question 18: Android doesn't support which of the following file formats?
- MIDI
- MP4
- MPEG
- AVI (Correct answer)
Correct answer: AVI
Android supports a wide array of media formats for audio and video playback, including common ones like MP4, MPEG, and MIDI. However, the AVI (Audio Video Interleave) format is generally not natively supported by the Android media framework. Developers often need to use third-party libraries or convert AVI files to compatible formats for playback on Android devices.
Question 19: How many layouts does Android have?
- 6 (Correct answer)
- 3
- 2
- 7
Correct answer: 6
Android provides several fundamental layout types to arrange UI elements on a screen, offering flexibility for various designs. The primary layout types include LinearLayout, RelativeLayout, FrameLayout, ConstraintLayout, TableLayout, and GridLayout. These six layouts form the basis for constructing user interfaces in Android applications.
Question 20: The Content Provider is turned on by .
- Using Content Resolver (Correct answer)
- Using Intent
- Using SQLite
- None of the above
Correct answer: Using Content Resolver
Content Providers are activated and accessed through a `ContentResolver` object. The `ContentResolver` acts as an intermediary, sending requests (query, insert, update, delete) to the appropriate `ContentProvider` based on the URI provided. This mechanism enables secure and standardized data sharing between applications.
Question 21: In Android, which of the following are the screen densities?
- Medium density
- High density
- Low density
- All of the above (Correct answer)
Correct answer: All of the above
Android devices are designed to support a wide range of screen densities to ensure optimal display quality across various resolutions and physical sizes. These densities include low (ldpi), medium (mdpi), high (hdpi), extra-high (xhdpi), extra-extra-high (xxhdpi), and extra-extra-extra-high (xxxhdpi). Developers provide different assets for these densities to ensure crisp visuals.
Question 22: Which of the following does not have anything to do with the fragment class?
- List Fragment
- Cursor Fragment (Correct answer)
- Dialog Fragment
- Preference Fragment
Correct answer: Cursor Fragment
Android provides several specialized `Fragment` subclasses to simplify common UI patterns. `ListFragment` is for displaying a list of items, `DialogFragment` for showing dialogs, and `PreferenceFragment` for managing application preferences. `Cursor Fragment` is not a standard or recognized subclass within the Android framework.
Question 23: Which of the following is the Android database?
- SQLite (Correct answer)
- Oracle
- MySQL
- SQL Server
Correct answer: SQLite
Android uses SQLite as its primary database for local data storage within applications. SQLite is a lightweight, embedded relational database management system that is integrated into the Android framework. It allows apps to store and manage structured data directly on the device efficiently and reliably.
Question 24: Which of the following are indirectDirect Service subclasses?
- RemoteViews Service
- Recognition Service
- InputMethod Service (Correct answer)
- SpellChecker Service
Correct answer: InputMethod Service
The `InputMethodService` is a direct subclass of `Service` in Android, providing the base class for implementing an input method, such as a soft keyboard. While other options like `RemoteViewsService`, `RecognitionService`, and `SpellCheckerService` are also specialized services, `InputMethodService` directly extends `AbstractInputMethodService`, which in turn extends `Service`.
Question 25: In Android, which of the following are the screen sizes?
- Large
- Extralarge
- Small
- All of the above (Correct answer)
Correct answer: All of the above
Android supports a variety of screen sizes to accommodate the diverse range of devices available in the market. These categories include small, normal, large, and extra-large. Developers design their layouts to be flexible and responsive, ensuring a consistent and optimal user experience across all these different screen dimensions.
What is the most recent Android smartphone version?