2

I know that we can use customized class loader to load a DEX file. What I would like to know is that is it possible to load multiple DEX files in an application and can we use custom loader for this purpose??

Thanks :)

Shoaib
  • 65
  • 7

1 Answers1

0

Yes, you can load multiple dex files in an application. As for a custom loader: I don't know. The app I work on uses the dalvik.system.DexFile class to load a dex file. For each dex file you load, simply keep a different handle to it.

Randy
  • 4,351
  • 2
  • 25
  • 46
  • Thanks for your reply. This means an APK can contain multiple dex files. Right? – Shoaib Dec 03 '13 at 06:30
  • If you mean the dex which an APK loads and uses (classes.dex), then probably not. If you mean putting multiple dex files into your assets folder and loading each dex file in your assets individually, then yes. – Randy Dec 03 '13 at 13:30
  • For very large apps we can partition into multiple Dex files as this blog suggests. [link](http://android-developers.blogspot.com/2011/07/custom-class-loading-in-dalvik.html) – Shoaib Dec 03 '13 at 13:42