.dex and .apk file: What are they and how do they execute ?


Actually, an APK file is a ZIP file, where you can found the Magic Number PK in the file header. It contains not only classes.dex but also other meta files such as AndroidManifest.xml which contains the basic configuration of this file.

A .dex file is just... uh, I regard it as a "real" executable, like an .exe file in Windows or an ELF in Linux, which contains the machine code(for Dalvik VM).


What is the difference between .dex and .apk file?

.dex file Compiled Android application code file.

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 by automatically by Android translating compiled applications written in the Java programming language.

Reference: Answer by Vineet Shukla

  • That's.. not how you refer to another post on SE. You should quote the relevant part, and give the link as the reference, not posting the link only. – Andrew T. May 10 '16 at 7:33
  • 1
    Okay. Didn't know that. Will keep in mind the next time. – Anonymint May 10 '16 at 7:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.