Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I compile Dalvik to run it locally on Linux?

Tags:

android

dalvik

What are the minimal steps necessary (including retrieving the source code) to compile and run just the Dalvik virtual machine on Linux?

like image 331
Steve Avatar asked Aug 22 '10 16:08

Steve


People also ask

What type of compiler was used in Dalvik VM?

Dalvik programs are written in Java using the Android application programming interface (API), compiled to Java bytecode, and converted to Dalvik instructions as necessary. A tool called dx is used to convert Java .

Is Dalvik virtual machine still used?

Dalvik is a discontinued process virtual machine (VM) in the Android OS that executes applications written for Android. Dalvik bytecode format is still used as a distribution format, but no longer at runtime in newer Android versions.

How does Dalvik virtual machine work?

Role of the Dalvik Virtual Machine The Role of the DVM in Android includes: Optimizing the Virtual Machine for memory, battery life, and performance. Conversion of class files into . dex file through Dex compiler that runs on Dalvik VM.


2 Answers

Actually , I got Dalvik working on my elementary OS installation.

First download the Android AOSP source tree using https://source.android.com/source/downloading.html. Wait for it to download (2 hours for me cloning only the current commits and Marshmallow branch)

After running build/envsetup.sh while in the source tree run lunch full_x86-eng. Then type make -jN (replace N with number of cores).

WAIT. This took me about 1 hour on an AMD-4500M laptop. Newer ccomputers may be as low as half and hour and older ones might take half a day.

Change directory to !!AOSP-PATH!!/out/host/linux-x86/bin/ and run export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:!!AOSP-PATH!!/out/host/linux-x86/obj/lib/ or

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:!!AOSP-PATH!!/out/host/linux-x86/lib

or export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:!!AOSP-PATH!!/out/host/linux-x86/lib64

TRY ALL OF THESE

and then ./dalvikvm --32. If you try to run without the --32 option it will crash (don't know why)

Working Marshmallow Dalvik. To get the GUI apps working you will need to do some more porting and coding which is another project which I am working on.

Took me half a day to figure this out.

References

http://milk.com/kodebase/dalvik-docs-mirror/docs/hello-world.html

like image 114
Suici Doga Avatar answered Oct 12 '22 22:10

Suici Doga


Use sabayon Linux. This is a distro that can natively run Android programs and all Linux ones too.

like image 44
raven myers Avatar answered Oct 12 '22 22:10

raven myers