What is the correspondence between application, process, and Java virtual machine?

Viewed 59

In Android, we can use android:process attribute to specify a process for the <activity> component. So what is the correspondence between application, process, and Java virtual machine? And is there any difference between common Java application and Android application about this question?

1 Answers

The Java of Android is an implementation of the Java language (which is just a standard) but it doesn't use the JVM (which is another implementation of the Java language).

Android actually compiles Java to a different bytecode and interprets this other bytecode at runtime using the ART (Android Runtime).

The "Java" of Android is completely different than the actual Java.

So what is the correspondence between application, process, and Java virtual machine?

Android is a fancy Linux distribution for smartphones. It is like Ubuntu for smartphones. Instead of using pre-existing desktop environments, Google wrote their own targeting smartphones and tablets. Ubuntu is just a fancy package manager. You can make your own Ubuntu in 5 hours. It is called Linux From Scratch (LFS).

The Java virtual machine is probably written in C or C++. It makes system calls just like any other C program out there. It is really nothing fancy. Just a very big software which interprets bytecode and translates it to actual syscalls.

Related