Just An Application

February 8, 2011

“Alien Dalvik” ?

Filed under: Alien Dalvik, Android, Dalvik, Java, Java VM, Mobile Java — Tags: , , , , — Simon Lewis @ 5:51 pm

It is going to be interesting to find out exactly how this works.

Despite the name it cannot simply be a standalone Dalvik port. After all, all Dalvik can do is run Dexes. In fact the following would seem to suggest that it might not involve a Dalvik VM at all

Alien Dalvik enables the majority of Android applications to run unmodified, allowing application store owners to quickly kick start Android application store services by simply repackaging Android Package (APK) files.

Its not clear why you would want to mess with the APKs unless you wanted to do something else at the same time, especially if they are signed, but who knows ?

Presumably unmodified in this context refers to the source code ?

To run the majority of Android applications unmodified it must implement all the standard Java APIs and the Android APIs used by those applications some how. If the source code does not need to be modified then all those classes and methods that are referenced need to be in the runtime.

Implementing a large part of what is approximately Java 5 plus a large part of some version of the Android APIs (which version is of course another problem) is not exactly trivial given that many of the Android API methods are actually native methods, or call native methods almost immediately, and they often use Android platform specific features, for example, Skia and Surfaceflinger to name but two. In fact it is quite difficult to see how it can run the majority of Android applications unmodified unless it actually contains what amounts to a largish chunk of, not to put to fine a point on it, Android.

Which leads on to the question of where this chunk might live ? Presumably it is not per downloaded application, so the chunk must (?) be pre-installed on the device, and it is this that the device manufacturer will be licensing (?).

There is also the question of memory footprint. Android relies quite heavily on code sharing via the Zygote mechanism to keep its memory footprint down. It is possible to achieve the same effect using the standard fork()/exec() mechanism if your VM has been written with that in mind, although this is one of the techniques that Oracle argues they have a patent on. This is not necessarily a problem if the underlying VM technology is licensed from Oracle, which it might be in this case.

Then there is the question of native code. Presumably Android applications that use native code need not apply ?

And then there is security. Android applications are sand-boxed on the basis of UIDs and permissions are enforced on the basis of GIDs. If the host OS does not have these or their equivalents then there is a problem. Equally if host OS native applications are not themselves sand-boxed, even if Android applications cannot get out of their sand-boxes, everything else on the platform may be able to get into them

And if there are host OS native applications as well then how do they co-exist without some form of integration at the window manager (or equivalent) level ?

As I say it will be interesting to find out how it actually works

Copyright (c) 2011 By Simon Lewis. All Rights Reserved.



  1. Their video demonstration boasts Alien Dalvik running applications that Myriad are unlikely to have source code to (Evernote, Photoshop, Google Maps) so it’s fair to assume they can handle apks and dex format code. They say Alien Dalvik is based on Dalvik Turbo, and I believe Dalvik Turbo was just some lashup between Myriad’s old Java runtime (Jeode or JBed) rendered interface compatible with Dalvik, I guess by wrapping it in code lifted from the Android Dalvik codebase.

    There are some interesting UI differences if you look closely at the Photoshop side-by-side. I imagine they’ve just chosen a pragmatic popular subset of Android APIs and hacked on it until it sorta, kinda works for a few good demos. As you say, getting to a usable, or indeed definable, level of broader Android app compatibility will be hard (multimedia? notifications?). Myriad is at MWC to find some sucker with a strategy/ecosystem problem like Nokia or HP/Palm to shovel money in their direction while they try to do it for real. The snakeoil spirit of Insignia lives on…

    Comment by PP — February 8, 2011 @ 10:41 pm

    • Agreed they are not re-compiling from the source, but the “simply repackaging” quote comes from them and I am curious as to why there is any need to do that at all.

      Comment by Simon Lewis — February 10, 2011 @ 9:59 am

  2. Interesting post…

    So what would it take to get android applications to run on say, an ARM system running a standard linux+X combo?

    I saw stuff about your earlier work porting dalvik for the N800, is this all that would be required (plus some interface to render in an X window)?

    Or are there other libraries and/or services that would be needed (from android, presumably)?

    And I presume that running in Linux would also resolve the native code issue?

    Comment by Edglex — June 1, 2011 @ 3:09 pm

    • Dalvik is quite frankly the least of your problems. If you wanted to in theory get any Android application at all running then you would need to implement all the APIs for a given version of Android. This would be a decidedly non-trivial undertaking. You would need to either port the Android system server or provide an alternative implementation. Application interaction with the system server requires either Android binder IPC support or its equivalent. Android application graphics require Skia or its equivalent and SurfaceFlinger or its equivalent. By the time you have got all of this stuff or their equivalents then you have something that looks remarkably like Android 🙂

      Comment by Simon Lewis — June 8, 2011 @ 6:46 pm

  3. (Second post with the ‘notify me’ option ticked!)

    Comment by Edglex — June 1, 2011 @ 3:34 pm

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: