1

I wonder if is it possible to run android applications DIRECTLY on a Linux distribution like ubuntu or gentoo? I mean running the apps on linux without the help of virtualbox,simulators like genymotion, on google chroom...

is it possible to compile a linux kernel in such a way to do this? if so, is there any guide to to describe the process step by step?

any help is appriciated

1

Yes, there is, though right now it's still experimental. It's called Anbox, and it uses kernel features to share the kernel between the distro and the Android system.

Oh, and no need to recompile the kernel at all.

0

No, it isn't. Even if you were running Linux on an ARM-based system, or only wanted to run apps for Android-x86, so that you didn't need an emulator, you'd still have the problem that the GNU userspace doesn't have the same facilities and libraries that Android has. The Android framework, the standard library used by all Android apps, doesn't exist for GNU/Linux, so the apps would not be able to run. It's nothing to do with compiling the kernel in a particular way.

  • what you said is resonable . but I searched and found some research project such as wiki or someone had claimed, he could compile ubuntu kernel to run android apps [stackoverflow] (stackoverflow.com/questions/26031710/…‎to-run-android-apps) – anil Dec 6 '14 at 12:21
  • He asked the question because he couldn't get it to work, and there are no answers. Your research seems to support my answer. – Dan Hulme Dec 6 '14 at 21:32
  • Has this changed since then? – Pavel Šimerda May 11 '16 at 10:45
  • @PavelŠimerda No, why would it have changed? The GNU and Android userspaces are both completely different. – Dan Hulme May 11 '16 at 11:39
0

Ubuntu 14.04-18.04

In all currently supported versions of Ubuntu and Debian-based Linux distros (Linux Mint, Kali Linux, Elementary OS, Tails, KDE Neon, etc.) that have the snapd package from the default Debian repositories installed, open the terminal and type:

sudo snap install --edge --classic anbox-installer

Start the anbox-installer script.

anbox-installer   

This will add a PPA to your software sources, download 406.8MB of archives and install new Linux kernel packages, all this in order to install anbox which is currently alpha software. To see what happens during the installation you can watch this screencast:

During the installation you will see this warning message:

IMPORTANT: THIS IS ALPHA LEVEL SOFTWARE. EXPECT INSTABILITY AND BUGS !!!!!

I installed Anbox anyway in Ubuntu 17.04, and the built-in Android apps included in Anbox worked out of the box, although the expected bugs and instability arrived as promised.

Reboot to finish the anbox installation.

sudo reboot  

Type "anbox" in the Dash and click the Anbox icon to start the Anbox Application Manager. In the Anbox Application Manager you will see a row of application icons. Click on an icon to launch it. The Android application will launch in a new window and you will be able to run it.

Anbox doesn't come with Google Play Store pre-installed and does not even have a package installer, so the only way to install additional applications in Anbox is through an Ubuntu software package named Android Debug Bridge (adb). You have to download the .apk file of the app you want to install, open the terminal, change directories using cd to the directory of the .apk file, and then install the app with a command that looks like this:

adb install /path/to/file.apk  

Downloading an .apk file from a warez website is a miserable security risk, however some applications allow you to download the .apk file from the application's official website, for example WhatsApp Messenger for Android.

Then maybe the app will install or maybe it won't install if the app requires additional dependencies that are not installed in your operating system. For example WhatsApp requires Java as a dependency. I already have Java installed in Ubuntu 17.04 so I tried to install WhatsApp.

adb install WhatsApp.apk  

I got an error message that said error: cannot connect to daemon. I closed Anbox and reopened it. I got another error message that said write: Broken pipe. I closed Anbox and opened it again and got the same error message. Anbox is buggy just like the anbox-installer script says it is. I closed Anbox and reopened it again and finally WhatsApp installed in Anbox.

enter image description here
Anbox in Ubuntu 17.04

When you open WhatsApp for the first time it shows you a screen with a message that says:

WhatsApp will send an SMS message to verify your phone number.  
Enter your country code and phone number.  

WhatsApp also asks if you want to give the app permission to access the files on your device which is another security risk in my opinion. I think it's OK to give WhatsApp permission to access the files on my phone, but I don't want to give the app permission to access the files on my computer. Permissions are a matter of fundamental importance in Linux. You should be very careful about giving permissions to an application that it doesn't already have by default, and the telegram-latest snap package in Ubuntu 16.04 has better support than WhatsApp including Telegram Calls voice calls which are currently available to users around the world.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.