Material required: Java files, AndroidManifest.xml, resources, assets(optional) • Procedure: Step 1: Your .java files or .kt files gets converted to .class files that is the ByteCode through “javac” or “kotlinc” command.
has its own byte code format and its own virtual machine that is Dalvik Virtual Machine. • Multiple .class files or class files from any .jar file gets converted to a single classes.dex file. • Dx tool from the build platform tools inside Android SDK converts multiple .class files into single classes.dex .
environment that can be an emulator, an operating system or complete hardware virtualization, that has implementation of resources without the actual hardware. • Two types of VM on basis of architecture: Stack Based architecture and Register Based Architecture.
environment that can be an emulator, an operating system or complete hardware virtualization, that has implementation of resources without the actual hardware. • Two types of VM on basis of architecture: Stack Based architecture and Register Based Architecture. • And yes, from previous examples you guessed right: JVM: Stack Based Architecture DVM: Register Based Architecture
register based architecture requires an 47% less executed VM instructions than stack based. • Register based code is 25% larger in code size than the corresponding stack based code but this overall effects around 1.05% on load of VM. • So overall performance is that Dalvik VM is taking 32.3 % less time to execute standard benchmarks. • Licensing issues from Sun side which also led to have conflicts and thus Android took another VM. • Used because of memory limitations, reduce system overhead, redundancies and bringing optimization to .class files. - And you will have the answer to WHY? 1 2 3 Dalvik VM JVM
Tool. • It allows to create, update zip compatible archive (apk, zip, jar). It can also compile resources into binary assets. • Printing permissions, printing resources, print configurations supported. • Step 3: aapt zip classes.dex, resources and AndroidManifest.xml into a zip archive called APK.
Every time your app runs, part of code important for its execution is going to be translated to machine code at that moment. Further caching while app is running. • DEX to ODEX conversion and copy to dalvik-cache. • Optimizations: • Replace method index with vtable index • Replace field index with byte offset • Replacement with inline calls • Cut Empty methods