28

I'm wondering why Android apps won't be able to be run natively on Ubuntu Touch. I mean, isn't it all just Linux?

Braiam
  • 66,947
  • 30
  • 177
  • 264
user287536
  • 301
  • 4
  • 9
  • 1
    Desktop environment is a big factor in what an application is compatible with. – Patrick C. James Oct 10 '14 at 15:26
  • I concur with @don.joey since this isn't something easily researched beyond a "yes" or "no" type of conclusion. – MGodby Oct 10 '14 at 15:42
  • There was some interesting discussion on the latest ubuntu live, that covered much of this topic: http://www.youtube.com/watch?feature=player_embedded&v=etMduYRRwDc 25:00 27:10 52:45 54:47 55:20 – Mateo Oct 10 '14 at 16:05
  • Isn't it also an issue that they likely have different CPUs? – Kevin Fegan Oct 10 '14 at 19:17
  • @KevinFegan no, both touch and android run on my nexus 5 with the same cpu – Mateo Oct 10 '14 at 20:52
  • Also: http://www.omgubuntu.co.uk/2014/09/install-android-apps-ubuntu-archon so who knows what is possible yet. – Mateo Oct 10 '14 at 20:54
  • @KevinFegan, that's a good point. The part that makes this ok is that every app developed for the Android platform is actually interpreted by the Java runtime. –  Oct 19 '14 at 19:38

4 Answers4

24

The short answer is "no."

Strictly speaking, the Linux kernel provides little more than a direct interface to the hardware it is running on. There is an entire stack of additional Android-phone-specific APIs, programs, applications, etc. on which Android applications depend. Additionally, Android does not run on a generic Linux kernel, but instead runs on one that has been highly customized by Google with the specific purpose of running their OS.

Even if it is technically possible to reproduce the entire stack required for Android applications to run on another system, it would be bloated and extremely inefficient.

Peter Mortensen
  • 933
  • 2
  • 11
  • 17
MGodby
  • 1,152
  • 6
  • 11
  • 3
    Right - running a set of phone libraries on a desktop that's 10 times more powerful is _extremely inefficient_? We've been running mobile phone emulators on desktops for a decade now. – MSalters Oct 10 '14 at 23:16
  • 4
    I answered on the premise that the asker meant natively, i.e. without emulators or virtualization. – MGodby Oct 11 '14 at 00:34
  • 6
    @MSalters An emulator would use _more resources_ to produce the _same output_ compared to a native program. That's pretty much the definition of inefficiency. And the Android Emulators are particularly slow in my experience. – jmathew Oct 11 '14 at 04:33
  • 1
    @jmathew From a developer's perspective (at least mine) one benefit to that is if an app runs reasonably well in an emulator on a slowish machine then it will perform reasonably well on the piles of low-end bargain phones out there. – zxq9 Oct 11 '14 at 09:24
  • @MGodby But if that's your premise, then that would get rid of all the inefficiency introduced by emulation. In other words you would in fact be running code natively on hardware much more efficient than the code was written for. The result should be code running blazingly fast. – kasperd Oct 11 '14 at 14:09
  • 2
    @jmathew I think what MSalters was trying to say was that when it has been practical for several years to use an emulator, then there is no way that running the same thing natively could be inefficient. – kasperd Oct 11 '14 at 14:11
  • If `sudo apt-get install wine` "reproduce[s] the entire stack required for" Win32 programs, how would including Android's userland be any more "bloated and extremely inefficient"? – Damian Yerrick Dec 28 '14 at 17:50
  • @tepples, it wouldn't, but programs ran in wine are almost always plagued with numerous performance issues and bugs. Occasionally something works fairly well, but it's either a lightweight program or you have a tremendously powerful computer that can afford the extra compute resources. – MGodby Jan 07 '15 at 19:40
  • Nice answer, +1 .Moreover Android Runtime (Dalvik or ART) is entirely different from linux environment.I have added a brief answer. – Faizan Akram Dar Mar 15 '15 at 03:33
1

This is a really old post so things are different now, yes you can run android apps on ubuntu touch but by using a compatibility layer like anbox or waydroid.

1

Nokia n900 runs maemo witch is a linux os and yet it can run android's app via the dalvik environement wich was develloped for it but never put on market or repisitories. Why? Only the society who developped the dalvik for n900 knows. Now there was another initiative call apkenv. Seems there's was not so much thing's to add to make the n900 running some android games and no matter about the gpu or cpu power or maemo's desktop the apps run there some lake like in any emulation but some runs perfectly some not. So about ubuntu touch it is not question of technic (may be i am wrong but one official ubuntu's touch phone is a xiaomi wich is used for android too so hardware is nor a problem in this case) but will and law thout that google won't be happy that ubuntu runs android app and use the google play as second repository (note that is is possible to download the .apk as .deb and install after).

Marco Ceppi
  • 47,783
  • 30
  • 172
  • 197
patrick
  • 11
  • 2
1

The answer to your question is a BIG NO.

Android is completely different from Ubuntu Touch although android is based on linux kernel but that does not mean that the native applications of android can run on linux and vice-versa.

The similarity in kernel between different OS doesn't make their applications executable on these different OS. Kernel is the lowest software layer of a system. Above kernel lies user space which consists of system software and application interface.

OS with the same kernel may have entirely different user spaces and native applications execute in a particular user space.

Moreover, Android apps are developed usually using java and android apps execute in a runtime environment (Dalvik or ART) which takes bytecode from JVM as an input , whereas linux applications are directly converted into machine code upon compilation.

Applications developed for android using C++ cannot be executed in linux environment directly rather they have to be compiled first for linux systems.

Faizan Akram Dar
  • 4,441
  • 1
  • 22
  • 31