Java Execution Environment: A typical java project consists of one or more source files with .java extensions. These files contain attributes such as classes, methods, variables etc. When the project is compiled with java complier called “javac” it generates class files with .class extension. These generated files are called bytecode. The byte code is then given as input to Java Virtual Machine which then interprets the bytecode and executes the program.
Android Execution Environment: Android applications are basically written in java with some extra libraries for android platform. So an android project is also composed of one or more source files with .java extensions. In android also the source files are complied to generate class files. But android platform has an addition tool named “dx” which again takes the class files as input and generates .dex files or in other words Dalvik Executable file. The generated .dex files are then given as input for Dalvik Virtual Machine which is the underlying virtual machine for android platform.