Why is it, that android apps are required to run inside a VM(dalvik/art)?

229 views

is this OS level restriction?

if so why did android decide to go this route? also why java? c# is also platform independent

​

another stupid question if there were a jvm implementation like dalvik or ART on iOS would the programme compiled for android run-on iOS?

if so, can anybody create said implementation or can it only be provided by apple?

In: 0

3 Answers

Anonymous 0 Comments

> is this OS level restriction?

It’s the way Android is designed, it’s not a “restriction” really it’s just how it works.

> if so why did android decide to go this route?

Hardware compatibility. If you run everything in a VM, then you can always target that VM with your code, regardless of what the underlying hardware is. As long as it’s running the interpreter your code will work. This is the entire point of java, “write once, run anywhere”

> also why java?

It’s just the choice they made, probably because at the time java was the more popular programming language and so access to java developers was easier, and java was designed from the ground up to be hardware independent which is a pretty big deal if you are outsourcing your hardware to independent manufacturers.

> another stupid question if there were a jvm implementation like dalvik or ART on iOS would the programme compiled for android run-on iOS?

It would run on the VM inside iOS, so it wouldn’t really be running on iOS.

You are viewing 1 out of 3 answers, click here to view all answers.