I wonder what Android MultiDex Application is like.

Asked 2 years ago, Updated 2 years ago, 21 views

As the title says, I am curious about Android MultiDex. As far as I know, the limit on the number of methods is lifted, but I would like to know the exact method of use and what kind of situation it is suitable for.

android

2022-09-21 17:42

2 Answers

When you compile a source code called Hello.java in Java, a file called Hello.class is created. Android uses a tool called dx to create several .class files as a single class.dex file. The dex (Dalvik Executable) file is a file format that runs on the Dalvik virtual machine (DVM) on Android. (https://source.android.com/devices/tech/dalvik/dex-format.html)

The number of functions cannot exceed 65K (65,536) due to the constraint of this dex file. To solve this problem, the concept of Multidex came up. When you apply Multidex, you're not creating one classes.dex file per APK, but you're creating multiple indexes files, such as classes1.dex, classes2.dex, to solve the 65K problem.

When you make a simple app, you don't have to apply Multidex considering the 65K problem. You can apply Multidex when there are many libraries you use, and when the app's functionality is added and the number of functions increases.

Please refer to the link posted by beginner's beginner's beginner's beginner's beginner's beginner's beginner's learner. :D


2022-09-21 17:42

Use when there are more than 65536 methods. Many libraries, especially the Google Library, were often crossed. If so, use it.

For instructions on how to use it, refer to the following. ^

^

https://developer.android.com/studio/build/multidex.html


2022-09-21 17:42

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.