Java is an object-oriented programming language independent of the platform used to create native applications for Android. It is a popular programming language developed by Sun Microsystems, now owned by Oracle. Java contains many of its predecessors’ powerful tools, such as C or C++ while trying to avoid their shortcomings.
The Android SDK contains many standard Java libraries such as those focusing on data structure, mathematics, graphics or network. It also contains libraries especially developed for Android.
There are many apps using Java for Android, such as Whatsapp, Facebook, Linkedin or FlipKart.
As for syntax, Java for Android and Java are the same language. The difference is the availability of libraries where some Java libraries cannot be used in Java for Android and vice versa – some Java for Android libraries cannot be used in standard Java.
A great difference is the form of API. Android does not run bytecode in Java through the classic JVM (Java Virtual Machine), but uses Dalvik for older versions or Android Runtime (ART) for newer versions instead.
Android devices do not trigger JAR files, but classes are compiled into proprietary bytecode format and triggered by Dalvik and a specialized virtual Android machine.
Dalvik has some characteristics distinguishing it from ordinary virtual machines:
Because the bytecode loaded into Dalvik virtual machine isn’t the same as Java bytecode and because of the way Dalvik load classes, it isn’t possible to load class packages using jar files. For Android libraries, it is essential to use a different procedure that uses copying the dex file into the private app storage before the file is loaded.