Running Android UI natively on desktop, not in emulator?

321 views
Skip to first unread message

luke

unread,
Jan 31, 2008, 9:51:54 AM1/31/08
to Android Developers
I was wondering if anyone has had success moving the Android UI
classes off the emulator to run natively on the desktop? The easiest
way to do this would probably be to run natively on the JDK. It would
help speed development immensely, because launch time would be
reduced, and you would be able to use hot code replace (which Dalvik
doesn't support).

Renato Mangini

unread,
Jan 31, 2008, 12:34:45 PM1/31/08
to android-d...@googlegroups.com

I think it would be an immense bunch of work, because most of the android features rely on native code :-(. Maybe, moving the native libs to the host could work, but I don't think it is worth, specially now that the new sdk is so close (with promises of several changes in the Eclipse plugin).

fry

unread,
Jan 31, 2008, 1:58:09 PM1/31/08
to Android Developers
You do not need to restart emulator each time you make a change in
your code (I also did so in the 1st weeks of work) - you can just make
a change in the code, then press run the application and the updated
version would start in the emulator almost immediately. Just do not
close the emulator window.

Anders

unread,
Jan 31, 2008, 2:24:15 PM1/31/08
to Android Developers
A bit off topic but: it would be cool to have a desktop Android
device. Similar to the emulator but not just for developers; ordinary
users could also have a desktop Android device that could be synced
with their mobile device. And the desktop Android device could have
real functionality including phone functionality. And: in this way
people could run Android applications even if they don't have a mobile
Android device.

The desktop Android device could be an ordinary program installable on
for example Windows, Mac OS X and Linux.

Wink Saville

unread,
Jan 31, 2008, 2:27:18 PM1/31/08
to android-d...@googlegroups.com
+1

Diego Torres Milano

unread,
Jan 31, 2008, 4:24:14 PM1/31/08
to Android Developers
Not even closer to running Android UI natively, but a workaround while
we figure it out: http://dtmilano.blogspot.com/2008/01/desktop-android.html

Anders

unread,
Jan 31, 2008, 6:11:55 PM1/31/08
to Android Developers
As I understand it, the Dalvik virtual machine is tightly dependent on
Linux for performance and other reasons, and that is beneficial when
running in mobile devices, but on today's desktop computers, Android
should be able to run using only Java. The apk files maybe contain
only Dalvik bytecode, and then that would have to be reconverted into
Java bytecode if that is possible.

Digit

unread,
Jan 31, 2008, 6:26:14 PM1/31/08
to android-d...@googlegroups.com
allow me to remark that unless you have the sources, you will be unable to run ARM binaries on an x86 desktop.
so emulation is the only viable route until then. and it's very unlikely that you'll be able to replace many of the system's native shared libraries with pure Java.

Wink Saville

unread,
Jan 31, 2008, 9:03:10 PM1/31/08
to android-d...@googlegroups.com
Digit wrote:
> allow me to remark that unless you have the sources, you will be
> unable to run ARM binaries on an x86 desktop.
> so emulation is the only viable route until then. and it's very
> unlikely that you'll be able to replace many of the system's native
> shared libraries with pure Java.
From my point of view I don't see any reason it needs to be pure Java.
When we do have the sources it will be possible to assess the situation.

Anders

unread,
Feb 1, 2008, 5:15:26 AM2/1/08
to Android Developers
I think most of the Android system can be implemented in pure Java
although some code may need to be native. But of course Android
applications contain Dalvik bytecode, and that could be more tricky to
reverse engineer. Maybe Google will release Dalvik for other OSes than
Linux. :-)

On Feb 1, 12:26 am, Digit <digit.andr...@gmail.com> wrote:
> allow me to remark that unless you have the sources, you will be unable to
> run ARM binaries on an x86 desktop.so emulation is the only viable route
> until then. and it's very unlikely that you'll be able to replace many of
> the system's native shared libraries with pure Java.
>

luke

unread,
Feb 1, 2008, 6:35:21 PM2/1/08
to Android Developers
Yes, that saves time -- but you can't modify the code while it is
running without restarting the program inside the emulator, i.e. hot
code replace (that unravels the stack and program state, re-compiles,
adjusts everything to work with the newly-compiled code, and restarts
in exactly the same place) is not supported on Dalvik. It is
supported in a limited way on the regular JVM, which is cool because
you can tweak your code as it is running. For incremental tweaking-
type development, this speeds up development by one or two orders of
magnitude depending on what you're doing.

luke

unread,
Feb 1, 2008, 6:35:58 PM2/1/08
to Android Developers


On Jan 31, 2:24 pm, Anders <i...@blabline.com> wrote:
> A bit off topic but: it would be cool to have a desktop Android
> device. Similar to the emulator but not just for developers;

Yes -- I have suggested to some of the OLPC guys that they should port
Android to OLPC. It would be a great dev platform for that device.

luke

unread,
Feb 1, 2008, 6:41:44 PM2/1/08
to Android Developers
There are two reasons I asked the original question:

(1) To reduce development round-trip time.
(2) To eventually be able to use Android as a platform to develop
"real" desktop applications. There is no reason that Android wouldn't
be *awesome* running on your primary desktop.

A lot of the stack is native code, yes -- but all that code compiles
fine on a standard Linux stack, so there's no reason it can't be
recompiled out of the emulator. All the Dalvik code was Java source
at some point, and then Java bytecode, so that should be trivial to
port. A simple port for now would just get the surface manager and a
few system services for event handling working, and then a lot of the
stack would run as-is, unless you were doing something tricky like
maps/sound/video.

Any updated idea of when this wonder-sdk will be released, and
especially source? Hopefully well before the end of the Android
Developer Challenge.
Reply all
Reply to author
Forward
0 new messages