Hacker News new | ask | show | jobs
Ask HN: Why is Android not just another GNU/Linux distro?
15 points by wusspuss 1315 days ago
I'm not asking why it's not classified as one, rather, why it wasn't made one.

Android's goals seem to be:

1. Make the UI play well with touch screens

2. Restrict the user's freedom

And I just don't see how either of those goals necessitated reinventing so much from scratch, including its own graphical server (instead of the existing X11), a GUI framework (and a laughably complicated one at that https://developer.android.com/topic/libraries/architecture/livedata ), its own init system, the entire fs layout, or, well, mandating the use of and reimlpementing an entire language with its own quirks (Java where you can't even reuse the code from the desktop because e.g. jdbc isn't availble etc).

It all would be somewhat understandable if Android consumed a lot less resources that the desktop-oriented linux (like you would expect from a mobile OS), but quite the opposite seems is the case (e.g. Debian requires mere 256MB of RAM compared to 2GB for Android, and even with 2GB Android will barely crawl). On a side note, it somehow requires 400GB (!!!) of disk space on your computer to build, not even comparable to e.g. Gentoo.

What all this reinventing of the wheel results in is the lack of so many good programs: the only browser on Android that so much as supports extensions is Firefox and even that one is buggy as hell on this platform, virtually all programs are very limited in functionality and buggy, etc.

So why would any company put so much effort into something seemingly that useless, making such an outright bad product? I understand Google is a monopolist so they can basically sell any piece of shit, but I don't understand why take so much effort to make it a piece of shit.

13 comments

> Android's goals seem to be:

> 1. Make the UI play well with touch screens

> 2. Restrict the user's freedom

If this is true then they're losing to Apple on both accounts :p

Realistically though, Android is just another Linux distro. You can open a shell and run all sorts of stupid Linux stuff if you have adequate user permissions. Frankly, that's kinda the problem; manufacturers being able to modify the AOSP led to every company building their own shitty UX. Now that the beast is out of the cage, Google is struggling to run damage control.

From a technical aspect, x11 is not sufficient for a modern multitouch display interface (much less anything running at 60hz or higher). A UI framework might be considered excessive, but GTK and Qt were both terrible choices for building robust mobile applications. Even today they aren't really great choices.

Honestly, I don't really see how any of your examples add up to Google making Android a "piece of shit". Their working relationship with the community is great, and the architectural choices being made over the past few years seem to indicate a lot of great progress. In Linux terms, you're getting mad at the kernel for problems that exist in userland.

Just because you can pop a shell doesn't really make Android a Linux distro in my book. I'm not an Android expert by any means, but apps don't use glibc do they? And I doubt sound goes through ALSA or PulseAudio, or that you can run purely native apps without some kind of Java shim, nor use dbus or hell is there even /etc? It has "Linux," but it's missing the "distro" part. userspace is so divergent, it'd be like calling OS X a BSD distro.
Android definitely doesn't use Linux as a runtime, but the implimentation of the kernel and userspace is quite Linux-like in my opinion. OSX isn't a BSD distro because it uses a non-BSD kernel with a BSD compatibility layer; Android on the other hand is Linux, but not GNU/Linux. Saying Android isn't Linux depends on your definition of Linux being incorrect.
> From a technical aspect, x11 is not sufficient for a modern multitouch display interface (much less anything running at 60hz or higher).

Can you expand on this part? I'm familiar with the arguments on why Wayland is an improvement over X11, but I was not aware of multitouch or high-refresh rate issues.

Sure, as someone who actually really likes x11 I think the distinction is easy to make. x11 is a feature-complete display protocol that has lots of bells and whistles; it's great for people who want an old-school desktop experience, but there are a lot of anachronisms that make it difficult to support for modern devices. For one, the compositor situation is a mess which makes it really difficult (if not impossible) to lock yourself at a smooth refresh rate. For two, the overlapping window model built into x11 display servers doesn't really reflect the fullscreen-app paradigm that most people expect from a smartphone. Finally, gesture support is a wreck on x11 unfortunately and held back by a number of issues (not the least of which being horrible stutter). There's a reason the community waited until Wayland to start building Linux phone stuff.

I say this as someone who likes Xorg more than most people. x11 is great if your workload can take advantage of it's feature-completeness. Most users would happily trade in VNC support for a locked 60fps interface and gesture support though.

Because Linux makes for a dogshit OS for phones, battery life would be about two hours, Debian already fails to put your laptop to sleep half of the time when you close the lid and you expect it to work well with your phone that you send to sleep every other minute?

Despite some weird architecture choices (binders are some weird ass things to handle), the deep changes to Android make it a tolerable OS for mobile purposes. Using X11? Sure, I love display servers that choke on high DPI and cannot do half the things modern compositors do efficiently.

LiveData is not part of the UI framework but merely a tool to provide updates to be listened to on the main thread. It's also half deprecated and you should probably be using flows instead. Why is it here? Because half the GUI toolkits on Linux are either absolute pieces of shit (GTK lol) or simply not enough.

>Debian already fails to put your laptop to sleep half of the time when you close the lid and you expect it to work well with your phone that you send to sleep every other minute?

Debian isn't made by a trillion-dollar company. Very few resources are allocated to testing it, worse yet, there's Redhat always breaking things ever since Gnome went to shit in 2011, which affects pretty much all DEs to some degree.

>Because half the GUI toolkits on Linux are either absolute pieces of shit (GTK lol) or simply not enough.

Last time I checked even GTK manages to NOT fuck up its widgets when resizing the window without requiring the developer to go through all the bullshit of LiveData and then a couple of years later also some new bullshit like Flow or whatever, until Google comes up with something yet more over-complicated.

Then there's also Qt which has even been ported to Android.

>Using X11? Sure, I love display servers that choke on high DPI and cannot do half the things modern compositors do efficiently.

X11 has XRender since ages. Now it has XCB and optimized setups.

And, OFC, composited Window Managers avoiding raw X11 calls with X11 extensions... since early 2000's.

Still doesn't do well with high DPI (most phone screens go around 500dpi), still doesn't do well with high refresh rates, etc.

Using X11 for any modern needs is an aberration.

I can recommend the book “Androids” for an in-depth look at the origins of Android and the team that built it:

https://www.amazon.com/Androids-Built-Android-Operating-Syst...

The definition of a phone OS was very different in 2005 when Google acquired Android Inc.

It was a tight platform originally, but so was Windows NT, and look at Windows today… That’s just the nature of success in the open OS space when you’re serving lots of hardware vendors.

There's a couple things

google doesn't like shipping GPL software to end users, and anyway, they had a lot of opinionated changes to make and plumb through, wakelocks and other things. No glibc, mininal other GPL stuff, it's not GNU/Linux, it's just Linux.

Display hardware for mobile SoCs often had no or poor x11 drivers during the early days of Android. x11 drivers are not easy to write, it's easier to do something else that has more specific requirements. Nowadays, I think you could probably do pretty well with glamor, but that wasn't a given back then. Limited capability mobile devices really don't need to run a distributed systems protocol that outputs to screens as a side effect, regardless of how cool distributed systems are.

Desktop apps running on a phone is not a good experience, and is unlikely to ever be a good experience. Applications need to be rebuilt for the context and if you're going to do that, x11 doesn't buy you much.

I'm not saying Android UI did a good job, but it made sense to start clean even if the results were poor.

>Display hardware for mobile SoCs often had no or poor x11 drivers during the early days of Android.

How is creating an entirely new SurfaceFlinger a solution to the lack of x11 drivers, logically? There could no drivers for SurfaceFlinger either, if it didn't even exist yet.

>x11 drivers are not easy to write,

I can't believe that's harder than redoing what X11 does from the ground up.

>Limited capability mobile devices really don't need to run a distributed systems protocol that outputs to screens as a side effect, regardless of how cool distributed systems are.

I don't see what the word "limited" has to do with anything here since system requirements of Android are greater than that of the desktop GNU/Linux. When a keyboard app eats away a hundred MBs, any overhead introduced by X11 is outright negligible.

And then even if X11 was so unsuitable that they just HAD to reinvent something, they could've done what Wayland is doing - reinvent it but that's it, don't reinvent the rest of the system, and keep it compatible with the existing ecosystem.

3. Sell more hardware through the upgrade treadmill.

> compared to 2GB [of RAM] for Android

Crikey, I didn't know that. I have a Nexus from 2012. It seems to have slowed down since I first bought it. Android has been upgraded since then, of course. It's not a phone, just a tablet. I was happy with my purchase at the time, although it seems to run slow as molasses now.

One big problem was that I had to log into my Inland Revenue account through an auth app that they had. They seemed to update it frequently, which of course needed a huge multi-megabyte download. I was actually concerned about this. Fortunately I was able to get the Inland Revenue to allow alternative authorisation, but I had to jump through a lot of hoops.

I now don't NEED my Nexus for anything. I use kik on rare occasions. My plan is to not use the device, unless there is some nice distro that runs on it. Any suggestions? It must be lightweight.

I can't really see the point of Android per se. It just seems like a bloat-tastic OS for devices that are ill-suited to bloat.

Now that you've got me ranting ... everything is poxy smartphone this and smartphone that these days. Scan a QR code? How? The hoops I have to jump through to get that sorted is unbelievable. They should just give me the text version.

I have a dumbphone, PAYG. I got it from Tesco (a UK supermarket) a couple of years ago. Cost me 25 quid, which included 20 quid worth of vouchers. So basically, I bought a phone for 5 quid. I doubt that Tesco could make them for that money. I told one guy about my purchase, and he laughed that I had been ripped off. Bizarre. I bought a legit phone for 5 quid. It does exactly what I want it to do. So joke's on you, pal.

Some people have no concept of frugality.

Maemo tried putting a fairly normal distro on a phone and the result wasn't good. Battery life was very short without wakelocks. There was no sandboxing AFAIK. Desktop apps "worked" but were really slow and had tiny UI that required a stylus.
> I'm not asking why it's not classified as one, rather, why it wasn't made one.

Because Android was intended to be a business platform that creates software artificial scarcity so that it can later be filled with paid products and services. Linux is an operating system which empowers the user by offering multiple choices for every problem. They have nothing in common, especially the kernel, which is ridden with closed source drivers and blobs. Being forced to use mostly one programming language (Java) which isn't exactly known for its performance also has a price to pay.

This is one of the Alpine Linux VMs I'm playing with.

https://ibb.co/rtRzW21

As you can see, a desktop with Firefox, Libreoffice and Gimp (the real ones, not dumbed down mobile versions) loaded can run in under 1GB or RAM and no swap. Note that this is the full x86_64 image one would use for real iron, not the VM optimized one which would probably save some more resources. I have also put it on two laptops and figures are identical. Just think of how many "obsolete" tablets could be saved from a landfill if manufacturers opened their firmware and unlocked old devices bootloaders once they're out of production. Android, as any other proprietary mobile OS, is used to prevent that, therefore I think turning it into a Linux distribution would require too much effort with an end result that would satisfy neither mobile OS users nor Linux hackers. Porting regular distros to mobile platforms is the way to go, although it's a very slow process because of the mobile industry working hard against it.

> Android, as any other proprietary mobile OS

You are aware of the AOSP, correct? This project enables other projects like LineageOS to do exactly what you're describing.

LineageOS is still buggy as hell (AFAIK it doesn't even make "stable" versions anymore since 2016 or so, just nightlies), still takes more resources than GNU/Linux, still doesn't support any good software from the desktop.

But yeah it can give you updates for a few more years after you purchase your phone if you're lucky. Still laughable compared to DECADES old pcs getting updates.

Yes, but the problem is that most platforms (namely tablets and phones) have either closed drivers or locked bootloaders, or both, which makes hard running AOSP on real iron.

edit: minor typo

That's just how everyone makes tablets now. I wish things were different, but they aren't.
Developer adoption operators? As horrible as it is sometimes it’s simpler to build and ship android apps to app The models and sub distrust than using existing Linux frameworks
Android is first and foremost a data harvesting platform, just like gmail. It's not conformant to other linux distributions because goggle wanted to control what was run there. This is even more apparent in studying the evolution of the "app store". apps are now required to conform to the most recent versions of spytware API in order to be distributed.

Don't worry, you can't escape. Your generation can't get married, or even laid, without an account at a multi-billion dollar corporation.

Best of luck with that...

You're thinking about the 'GAPPS' or Google apps, not Android. Those who run AOSP-derived distributions usually have to consciously install those 'GAPPS' - which includes the Google Services Framework (GSF) which some apps insist they can not run without but which often work just fine after dismissing the annoying popup. If you do not install this package you do not get access to those Google services and Google does not get access to your data - the choice is yours.

I have never installed GAPPS on any of my Android devices. I do have microG installed on one device to see whether it does make those apps which do not work without the GSF useable - it mostly does - but I do not use it on my daily devices because even microG does leak some data to Google by connecting to their services.

Banking apps work on my Google-free phone. The Swedish electronic ID service ('BankID') also works. What am I missing?

I believe AOSP is pretty de-googled.
Android doesn't use GNU so it's not GNU/Linux. Problem solved.
Desktop linux (and most other desktop OSs for that matter) have utterly terrible security. You are running literally everything under the same user, which has permissions for reading-writing all of your browser caches, ssh configs, home directory from family photo backups to all your documents. A shitty bash script can encrypt whatever it feels like, the old xkcd comic is still true, the only thing an attacker can’t freely do is.. install a video card driver.

Android’s biggest contribution/change is the security model — the old UNIX one is simply way too crude, so instead android runs each application as a new, dynamically created user so that UNIX permissions actually get used properly, to a degree. But that in itself wouldn’t solve the problem of who gets to communicate with whom and who gets to use system resources, so an IPC mechanism is introduced which connects daemons with elevated permissions to ordinary applications. All this tries to cleverly build on plenty of Linux tooling/development (re-use of UNIX permissions, users, process isolation and SELinux), but puts them together in a quite novel way, creating a much bigger difference than what you would find even between Ubuntu and Gentoo.

Also, calling the biggest mobile OS a bad product is quite stupid, it is a stable and well-architected system, with a similar chaos at the top layer as what you can see in the linux distro scene, where every player does their own thing. Blame these vendors, not the core project. GrapheneOS for example for example has none of the bullshit privacy violations of big vendors.

(But I have to agree regarding the Java part, they should have followed the language development much more closely)

>Android’s biggest contribution/change is the security model — the old UNIX one is simply way too crude, so instead android runs each application as a new, dynamically created user so that UNIX permissions actually get used properly, to a degree.

That doesn't justify any of the other Android's "traits". It's also not clear why that couldn't be done as part of regular gnu/linux, as it is being done now with Wayland + flatpak/firejail/anything that introduces that sort of security model WITHOUT destroying the entire ecosystem. That would actually seem easier as that'd involve much less reinventing.

Because it predates them? Also, flatpaks/etc don’t provide nearly the same level of security that android does. A fundamental part of Android security is that it is user-controllable at runtime even, giving the user more liberty. You don’t just start a program in firejail with a given incantation and later kill it to restart with camera on.
>Because it predates them?

I know, point is Android could've been something like regular linux + flatpak, that's it. If "security" were so important to them they could just invent flatpak without reinventing the rest of the system.

>Also, flatpaks/etc don’t provide nearly the same level of security that android does.

1. There's an order of magnitude less effort being spent on them. They're like RedHat's side gig or something. So not exactly a fair comparison.

2. Who are you kidding praising Android's security? A couple of years after purchase that thing stops getting security updates anyway.

>A fundamental part of Android security is that it is user-controllable at runtime even, giving the user more liberty.

1. Initially it wouldn't allow you to reject an app's permission. You could only see what an app is allowed

2. Who are you kidding calling Android user-controllable? The thing doesn't even give you root access. Also all apps are mostly proprietary and can just refuse to work if you don't give them what they want.

Just to add, because your rant is really not constructive and dismissive of a whole platform: android likely has more apps than desktop linux, plenty of them in better shape as well. Why on Earth would they be buggier, when they do in fact see more users?

Android project back-ported countless battery optimizations to the kernel, so the less shitty battery life of your laptop is thanks to the project. (It still sucks thanks to all the other parts of the linux desktop stack not caring about it). Seriously, just have a look at the pinephone, which would easily have 6-8+ hours of battery life on Android, yet it burns like fire in 2 hours with one gnu/linux-based mobile os.

>Just to add, because your rant is really not constructive and dismissive of a whole platform: android likely has more apps than desktop linux, plenty of them in better shape as well. Why on Earth would they be buggier, when they do in fact see more users?

What exactly is "in better shape" on Android? Why is there not a single file manager whose functionality even approaches that of say Caja or Dolphin, but which also doesn't have ads built-in? Why is multi-window some novel experimental afterthought when it's been done properly for DECADES now several times over?

>Android project back-ported countless battery optimizations to the kernel

I do wonder if just NOT making it a platform for spyware always running in the background (google services but also pretty much everything else, install Autostarts and see) would be more effecient...

>which would easily have 6-8+ hours of battery life on Android, yet it burns like fire in 2 hours with one gnu/linux-based mobile os.

Most reviews say quite the opposite, especially about screen off mode.

Control.
Do you think the experience of using desktop Chromium on a phone would be good?
Well, given how all mainstream desktop programs are getting huge buttons these days...
Touche.