27

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

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
Steve
  • 1,512
  • 1
  • 14
  • 17
  • 2
    You can port it to unseen architectures by following this: http://source.android.com/porting/dalvik.html – James Black Aug 22 '10 at 16:39
  • Does it not run on x86 at all then? Sorry, I didn't realise this. – Steve Aug 22 '10 at 21:45
  • 3
    This question is a duplicate of: http://stackoverflow.com/questions/1297678 The answers for that question include directions for building a Linux dalvikvm using the "sim-eng" lunch target. – Jesse Wilson Aug 23 '10 at 01:09
  • 1
    Thanks, that question contains a link to the "dvk" project, which I'll just repeat here for future reference: http://code.google.com/p/dvk/wiki/Installing This project which I hadn't previously come across basically answers my question. – Steve Aug 23 '10 at 01:57
  • I have added a working answer. Not one that tells you to code or says it's impossible – Suici Doga May 11 '16 at 12:12
  • Getting Dalvik and the runtime is easy since Android is based on Linux. What is hard is getting the GUI apps to show since Android does not use X11 / Wayland – Suici Doga May 12 '16 at 07:21

7 Answers7

8

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

Suici Doga
  • 343
  • 6
  • 18
3

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

Lee Taylor
  • 7,761
  • 16
  • 33
  • 49
raven myers
  • 585
  • 1
  • 6
  • 5
  • 2
    thanks lee ;) i am just 13 and make these mistakes all the time. – raven myers Nov 17 '12 at 20:33
  • 2
    +1s for "Awwwwww" factor (and good answer) =] (Apologies if that's slightly patronizing) – earcam Mar 14 '13 at 17:54
  • 3
    Argh, I think it was just a joke - the post was from April 1st .... http://lxnay.wordpress.com/2012/04/01/supporting-android-market-google-play-apps-in-rigo/ =( – earcam Mar 15 '13 at 15:05
3

Actually, that's rather android running on Dalvik and the underlying system is already linux.

I guess running a bare Dalvik VM on a desktop linux box is just a matter of getting the sources and compile it.

The GUI stuff is something else.

Stephan
  • 41,764
  • 65
  • 238
  • 329
Laurent
  • 39
  • 2
1

You are not the only one with this idea, and that is great in internet society terms.

This is probably what you are looking for: http://www.android-x86.org/. Those guys ported android over to x86.

It still works as an OS, so I'm not sure if you can run Linux and Android(Linux) together without using VirtualBox.

acj
  • 4,821
  • 4
  • 34
  • 49
Tijs Maas
  • 3,793
  • 2
  • 16
  • 7
0

Dalvik runs on Android. The authors of Dalvik are only worrying about it running on Android, as far as we are aware.

Various groups have indicated they are working on getting Dalvik outside of Android. You are probably best off finding and talking to them.

In other words, there are no official instructions of the type you seek.

Sorry!

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • 3
    ...other than dalvik/docs/hello-world.html in the source tree. In gitweb, see http://android.git.kernel.org/?p=platform/dalvik.git;a=blob_plain;f=docs/hello-world.html;hb=HEAD . – fadden Aug 23 '10 at 23:27
  • 3
    that link appears broken. it's also mirrored http://www.milk.com/kodebase/dalvik-docs-mirror/docs/hello-world.html – Vitali May 17 '12 at 07:47
0

Getting apps designed for Android to run on Linux is going to be tricky. However, it is possible to run a Dalvik VM on Linux. In fact, this GitHub project has a pre-compiled binary of Dalvik VM for Linux, ready to use! Check the associated blog post for information about how the binary was compiled and how to use it.

Flight Odyssey
  • 2,267
  • 18
  • 25
-1

Learn to program Java \ C \ C++ and other frameworks

Modify the Android source (I think app_process or something) so it shows a windows on the Linux desktop (learn X11 / Wayland APIs)

Below is a simpile base for you to start with

www.android-x86.org/getsourcecode

Getting Android-x86 source code

First, follow this page to configure your build environment. Then

mkdir android-x86
cd android-x86

repo init -u git.android-x86.org/manifest -b $branch
repo sync

Where $branch is any branch name described in the previous section. This will point the projects created or modified by android-x86 to our git server. All the other projects still point to AOSP. We also have a git mirror server on SourceForge.net. To use it, you only need to change the repo init command to

repo init -u git.code.sf.net/p/android-x86/manifest -b $branch
Suici Doga
  • 343
  • 6
  • 18