Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android 'dx' tool

Tags:

Is there any documentation for 'dx'?

In particular, I am interested in knowing what the --core-library option does.

like image 673
Liz Avatar asked Dec 13 '11 10:12

Liz


People also ask

What is dx tool in Android?

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.

What is DX file and how it is generated Android?

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.

How do I run Sdkmanager?

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.

What is meant by Android SDK?

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.


1 Answers

What is the 'dx' tool?

The dx tool converts Java class files into a *.dex (Dalvik executable)* file.

Where is it?

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.

How does it fit in Android?

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:

Build process

FYI:

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

like image 139
Durai Amuthan.H Avatar answered Oct 21 '22 21:10

Durai Amuthan.H