Is there any documentation for 'dx'?
In particular, I am interested in knowing what the --core-library
option does.
The dx tool lets you generate Android bytecode from . class files. The tool converts target files and/or directories to Dalvik executable format (. dex) files, so that they can run in the Android environment.
Android programs are compiled into . dex (Dalvik Executable) files, which are in turn zipped into a single . apk file on the device. . dex files can be created automatically by Android, by translating the compiled applications written in the Java programming language. Follow this answer to receive notifications.
To open the SDK Manager from Android Studio, click Tools > SDK Manager or click SDK Manager in the toolbar. If you're not using Android Studio, you can download tools using the sdkmanager command-line tool.
The Android SDK is a software development kit that includes a comprehensive set of development tools. These include a debugger, libraries, a handset emulator based on QEMU, documentation, sample code, and tutorials.
The dx tool converts Java class files into a *.dex (Dalvik executable)* file.
The dx.jar file was original located under android-sdk/platforms/android-X/tools/lib/ before (especially in Android 3 and Android 4) and was moved to android-sdk/platform-tools/lib/ later.
The Java source files are converted to Java class files by the Java compiler.
The dx tool converts Java class files into a *.dex (Dalvik executable)* file. All class files of the application are placed in this .dex file. During this conversion process redundant information in the class files are optimized in the .dex file.
For example, if the same String is found in different class files, the .dex file contains only one reference of this String.
These .dex files are therefore much smaller in size than the corresponding class files.
The .dex file and the resources of an Android project, e.g., the images and XML files, are packed into an .apk (Android Package) file.
To understand better, look at the Android build process:
The program AAPT (Android Asset Packaging Tool) performs APK creation. The resulting .apk file contains all necessary data to run the Android application and can be deployed to an Android device via the ADB (Android device bridge) tool.
Reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With