Lesson plan

Comparison of Java and Android API

This article compares the application programming interfaces (APIs) and virtual machines (VMs) of the programming language Java and operating system Android. While most Android applications are written in Java-like language, there are some differences between the Java API and the Android API, and Android does not run Java bytecode by a traditional Java virtual machine (JVM), but instead by a Dalvik virtual machine in older versions of Android, and an Android Runtime (ART) in newer versions, that compile the same code that Dalvik runs to Executable and Linkable Format (ELF) executables containing machine code. Java bytecode in Java Archive (JAR) files is not executed by Android devices. Instead, Java classes are compiled into an android bytecode (dex bytecode) format and run on Dalvik (or compiled version thereof with newer ART), a specialized virtual machine (VM) designed for Android. Unlike Java VMs, which are stack machines (stack-based architecture), the Dalvik VM is a register machine (register-based architecture). Dalvik has some traits that differentiate it from other standard VMs: * The VM was designed to use less space. * The constant pool has been modified to use only 32-bit indexes to simplify the interpreter. * Standard Java bytecode executes 8-bit stack instructions. Local variables must be copied to or from the operand stack by separate instructions.…

Back to article

Article summary

This article compares the application programming interfaces (APIs) and virtual machines (VMs) of the programming language Java and operating system Android. While most Android applications are written in Java-like language, there are some differences between the Java API and the Android API, and Android does not run Java bytecode by a traditional Java virtual machine (JVM), but instead by a Dalvik virtual machine in older versions of Android, and an Android Runtime (ART) in newer versions, that compile the same code that Dalvik runs to Executable and Linkable Format (ELF) executables containing machine code. Java bytecode in Java Archive (JAR) files is not executed by Android devices. Instead, Java classes are compiled into an android bytecode (dex bytecode) format and run on Dalvik (or compiled version thereof with newer ART), a specialized virtual machine (VM) designed for Android. Unlike Java VMs, which are stack machines (stack-based architecture), the Dalvik VM is a register machine (register-based architecture). Dalvik has some traits that differentiate it from other standard VMs: * The VM was designed to use less space. * The constant pool has been modified to use only 32-bit indexes to simplify the interpreter. * Standard Java bytecode executes 8-bit stack instructions. Local variables must be copied to or from the operand stack by separate instructions.…

Key claims

No claims recorded.

Discussion questions

  1. Summarise the article in your own words. Which single claim would you verify first, and why?
  2. Which claim in this article is most likely to be revised as the sources update? How would you check its current status?
  3. If two sources disagreed about one of these facts, what would you need in order to trust one over the other?

Bibliography

No sources recorded.

Key claims and bibliography are generated from the same tracked claims and sources as the article page.