Practical No. 03
Practical No. 03
Practical No. 03
Experiment No. 03
Title of the experiment Configure android development tools (ADT) plug-in and create android virtual
device
Java bytecode, which is an intermediate form of code generated by the Java compiler, is not
directly executable on Android devices.
Android devices use a different runtime environment (Dalvik or ART) and a specific bytecode
format (DEX/ODEX) optimized for mobile platforms.
Java bytecode needs to be translated into Android bytecode to run on Android devices, and
this translation is part of the Android app build process.
Exercise:
In Gradle, a build type is a configuration that specifies how a project should be built.
It allows developers to define different configurations for building their project based on
various factors such as the target environment, release or debug settings, or any other
custom requirements.
Build types are commonly used in Android projects but are applicable to other types of
projects using Gradle as well.
The build process in Android involves the compilation and packaging of source code,
resources, and other assets into an Android application package (APK) that can be
installed and run on Android devices.
The build process is orchestrated by the Gradle build system, which is the default build
tool used for Android projects.
Here is an overview of the key steps in the Android build process:
1. Project Structure:
Android projects organize source code, resources, and the manifest in a specific
directory structure.
2. Gradle Scripts:
Gradle build scripts define project configurations, dependencies, and tasks at
project and app levels in Android projects.
3. AndroidManifest.xml:
The AndroidManifest.xml file holds crucial app information, including package
name and permissions.
4. Resource Compilation:
Android resources are compiled into binary format using the aapt tool.
5. Java Compilation:
Java source code is compiled into bytecode by the Java Compiler (javac).
6. Dexing (Dalvik Executable):
Java bytecode is converted to Dalvik Executable (DEX) format for Android
runtime.
7. Library Dependencies:
Gradle manages external libraries, fetching and including them based on build
script configurations.
8. APK Generation:
The final APK is generated by bundling code, resources, and manifest using the
assemble task in Gradle.
9. Signing the APK:
The APK is signed with a private key for integrity and authenticity.
10. Installation and Deployment:
The signed APK is installed on Android devices or emulators for testing using the
install task in Gradle.