Android: Jumbo Mode vs Multidex

后端 未结 2 1737
隐瞒了意图╮
隐瞒了意图╮ 2020-12-08 20:25

I\'m not totally sure what the difference is between setting dex option \"jumbomode\" to true vs adding multidex support.

Setting jumbo mode to true or multidex to t

相关标签:
2条回答
  • 2020-12-08 20:55

    Jumbo Mode, when reading https://source.android.com/devices/tech/dalvik/dalvik-bytecode.html, the const-string/jumbo is the jumbo mode for string. It is about the opcode such that "op vAA, string@BBBBBBBB" versus "op vAA, string@BBBB", 32 bits versus 16 bit.

    Multi Dex is to allow to load classes from more than one dex file. The primary classes.dex must contain the classes necessary for calling this class methods. Secondary dex files found in the application apk will be added to the classloader after first call to MultiDex.install(Context) see https://developer.android.com/reference/android/support/multidex/MultiDex.html

    0 讨论(0)
  • 2020-12-08 20:58

    take a look into this (search for jumbo):

    https://developers.soundcloud.com/blog/congratulations-you-have-a-lot-of-code-remedying-androids-method-limit-part-1

    in short: - similar to Android Method count limit (64K) - there's a limit on string count (64K) - to overcome this limit - jumbo mode enables referencing more than 2^16 strings by using special opCode that enables encoding up to 2^32 strings.

    in practice: - from my experience both (MultiDex & JumboMode) have major impact on apk installation time (much slower).

    hope this helps:)

    0 讨论(0)
提交回复
热议问题