user275475
user275475

Reputation: 173

Can the android JVM run on a PC also?

Can the Android JVM run on a PC also?

or is it limited to working on a mobile device only?

From what I understand, when you develop using eclipse it is emulated, not running the actual jvm correct?

Upvotes: 8

Views: 4159

Answers (5)

Manfred Moser
Manfred Moser

Reputation: 29912

Yes and no. The Android VM is actually called Dalvik VM. It executes dalvik executables (dex) which are normally packaged as Android Packages (apk) file. The dex files are created from Java byte code files (output of a java compile, .class files) which run on a regular jvm. Currently the Dalvik VM runs on ARM and MIPS based processors. When you talk about running on a PC I assume you are talking about a x86 based computer. In this case you need to use an emulator to run the vm. The standard emulator that is shipped with the Android SDK uses qemu (qemu site) to run emulator the standard arm processor.

There is also a porting effort to x86 under way but the most common way currently is emualtion.

In terms of android running on netbooks it all comes down to the processor again...

Also keep in mind that if you want to run Android applications on a PC you need more than just the VM. You basically need to run the whole linux stack (e.g. including video codecs and so on). The easiest way to do that is to run an emulator.

Upvotes: 7

Elliott Hughes
Elliott Hughes

Reputation: 4665

all the other answers are wrong. if you really do just want the VM, you can run dalvikvm on Linux.

you'll have to build it yourself though... see my answer to How do I make isolated dalvik for details on how to do that.

Upvotes: 4

Manfred Moser
Manfred Moser

Reputation: 29912

Another clarification. The Android SDK emulator uses dalvik bytecode. The only way the jvm is involved is in the compilation process. Java source code -> java byte code -> davlik executable code...

Upvotes: 0

Kristian
Kristian

Reputation: 6613

Yes, the Android SDK ships with an emulator to test your applications on PC.

Programs are compiled into Dalvik executable bytecode not Java bytecode. See http://en.wikipedia.org/wiki/Dalvik_virtual_machine for more details.

Upvotes: 1

OscarRyz
OscarRyz

Reputation: 199225

Yes it can, but it have to be ported to the actual PC architecture. No such thing exist ( yet ) AFAIK

Upvotes: 0

Related Questions