TY Assignment No 3 and 4
Unit – II : Introduction to Android Environment
Q1. What is Java JDK? Why is it essential for Android application development?
Answer:
Java Development Kit (JDK) is a complete software package required to develop applications using the Java programming language. It contains the Java compiler, runtime environment, and supporting development tools.
In Android development, JDK is essential because:
Android applications written in Java must be compiled using Java compiler tools provided by JDK.
Android build system internally depends on JDK to convert source code into bytecode before further Android-specific processing.
Without JDK, Android Studio cannot compile or execute Java-based Android applications.
Thus, JDK forms the language-level foundation of Android development.
Q2. What is Android SDK? Explain its role in building mobile applications.
Answer:
Android Software Development Kit (SDK) is a collection of libraries, APIs, tools, and system images that enables developers to create Android applications.
The role of Android SDK includes:
Providing APIs to access Android OS features such as camera, GPS, network, and sensors.
Supplying build tools that convert application code into installable APK files.
Offering platform tools like emulators and debugging utilities.
Supporting application compatibility across different Android versions.
Android SDK acts as the interface between application code and Android operating system.
Q3. How does Java JDK differ from Android SDK in Android development?
Answer:
Java JDK and Android SDK serve different but complementary purposes.
JDK is responsible for language-level compilation of Java code.
Android SDK is responsible for platform-level integration, device access, and application packaging.
JDK is generic for Java applications, whereas SDK is Android-specific.
Both are mandatory, but SDK cannot function independently without JDK.
Q4. What are Android Development Tools (ADT)? Explain their significance.
Answer:
Android Development Tools (ADT) is a set of tools that were earlier used as a plugin with Eclipse IDE to support Android application development.
Its significance includes:
Simplified project creation and management.
Integrated debugging and testing support.
Automatic resource management and APK generation.
Although ADT is now obsolete, it laid the foundation for modern Android development environments.
Q5. What is Android Virtual Device (AVD)? Why is it required?
Answer:
Android Virtual Device (AVD) is a configuration file that defines the specifications of an Android emulator.
AVD is required because:
It allows testing applications on virtual devices without physical hardware.
Developers can simulate different screen sizes, OS versions, memory limits, and hardware features.
It helps in validating application behavior across multiple device configurations.
AVD ensures device-independent testing.
Q6. What is an Android Emulator? Explain its role in application testing.
Answer:
An Android Emulator is a software application that imitates the functionality of a real Android device on a computer system.
Its role includes:
Executing Android applications in a controlled environment.
Simulating phone features like calls, messages, sensors, GPS, and network states.
Allowing developers to debug applications efficiently.
The emulator works based on AVD configurations.
Q7. What is Dalvik Virtual Machine (DVM)?
Answer:
Dalvik Virtual Machine (DVM) is a register-based virtual machine specifically designed for Android operating systems.
Key characteristics:
Executes Dalvik Executable (
.dex) files.Optimized for low memory and battery consumption.
Each Android application runs in its own isolated DVM instance.
Supports efficient multitasking on mobile devices.
DVM was used in earlier versions of Android.
Q8. What is Java Virtual Machine (JVM)?
Answer:
Java Virtual Machine (JVM) is a stack-based virtual machine used to execute Java bytecode (.class files).
Characteristics:
Platform-independent execution environment.
Designed for desktops, servers, and enterprise systems.
Emphasizes portability rather than mobile optimization.
JVM is not directly used in Android runtime execution.
Q9. Distinguish between DVM and JVM.
Answer:
| Parameter | DVM | JVM |
|---|---|---|
| Architecture | Register-based | Stack-based |
| File format | .dex | .class |
| Optimization | Mobile devices | Desktop/server systems |
| Memory usage | Low | High |
| App isolation | Separate VM per app | Shared VM |
Q10. What is Android Runtime (ART)? How is it different from DVM?
Answer:
Android Runtime (ART) is the runtime environment responsible for executing Android applications in newer Android versions.
Differences from DVM:
Uses Ahead-Of-Time (AOT) compilation instead of Just-In-Time (JIT).
Improves application startup speed.
Enhances battery efficiency and performance.
Reduces runtime overhead.
ART provides better execution efficiency and stability.
Q11. What is Over The Air (OTA) update in Android?
Answer:
Over The Air (OTA) update is a wireless method used to deliver Android OS updates and security patches directly to devices.
Features:
No physical connection required.
Automatic user notification.
Ensures devices remain updated and secure.
OTA simplifies software maintenance.
Q12. What is Firmware Over The Air (FOTA)?
Answer:
Firmware Over The Air (FOTA) refers to wireless updates specifically meant for device firmware.
Purpose:
Updates low-level system software.
Improves hardware compatibility.
Fixes critical system bugs.
FOTA focuses on device-level reliability.
Q13. Explain GPS and Google Cloud Messaging (GCM) in Android.
Answer:
GPS (Global Positioning System) enables location-based services such as navigation, tracking, and mapping.
Google Cloud Messaging (GCM) allows servers to send push notifications and messages to Android devices.
Both enhance real-time interaction and user engagement.
Q14. Explain Android directory structure.
Answer:
Android directory structure organizes application components systematically.
Major Directories:
java/– Application logicres/– User interface and resourcesAndroidManifest.xml– Application configurationGradle Scripts– Build and dependency control
Analogy: Android Project as an Organization
java/→ Employees doing core workres/→ Support departmentsManifest→ Company rules and identityGradle→ Management and planning