4 ms·
Which parts? I'm surprised this isn't well known already. Large parts of Android are written in Java. Amongst other things: * All the UI libraries, networking
by native_samples 5y ago
Which parts? I'm surprised this isn't well known already. Large parts of Android are written in Java. Amongst other things:
* All the UI libraries, networking APIs code.
* All the system apps and services like the home screen, the keyboard, the system server, the window manager, the telephony subsystem (very important!) and so on.
* Many of the system APIs including services like the alarm manager, dropbox manager, some cryptography services, location services etc.
* The entire developer toolchain: the build system and the IDE.
* All the client logic for Google Play Services, which is a big part of the overall Android API now.
* Large parts of the compatibility test suite.
* The standard libraries for all the above.
Just browse through the code and see for yourself: https://cs.android.com/android/platform/superproject https://cs.android.com/android/platform/superproject
Most of the Java code is under the frameworks directory. No, not all Android code is written in Java. Lots of devs want to be able to use C++, and for some things its necessary. The point of the upgrade projects I just mentioned is that they are tackling the remaining cases where C++ can outcompete Java for things like media codecs. And the Java world has developed a JVM written in Java, actually several of them, so whilst Google hasn't done it, the tech is actually there. All this exists today, whereas an entire widely adopted consumer OS written fully in Rust is only a pipe dream.
Oh, and as for drivers, Google moved drivers out of the kernel and into user space some time ago (Project Treble):
https://source.android.com/devices/architecture https://source.android.com/devices/architecture
You can in fact now write drivers in Java. Google recommend you don't, but it's architecturally possible:
https://source.android.com/devices/architecture/hidl-java https://source.android.com/devices/architecture/hidl-java
- pjmlp 5y agoApparently the idea that Android is a Linux distribution is hard to dispel, because most rather read what is written in some random blog posts patting their backs about "Linux victory" than actually read what is going on at AOSP and Gerrit PR.
- GuB-42 5y agoAndroid is Linux because it uses the Linux kernel. It is not GNU/Linux, which is what people think about when talking about Linux distributions. Richard Stallman is known to throw a tantrum every time someone omits the "GNU" part but now, with Android, he has a point.
- pjmlp 5y agoExcept the little detail that pisses off termux guys, neither Linux kernel nor POSIX compliance are part of public Android userspace APIs. Targeting Android/Linux, if you so wish, it is no different than targeting Windows from GNU/Linux point of view.
- forty 5y agoI guess it all depends where you make the "OS" stop :) I'd say the kernel, the drivers and the JVM are already enough to say that Android is not "mostly written in java". And that's not not to talk about whatever shit operating system is running on the modem.