Hacker News new | ask | show | jobs
by pjmlp 2056 days ago
Android was always about Java (now Kotlin).

The NDK was only added in 2.0 to appease game developers and workaround for Dalvik anemic performance.

Any access to Linux APIs was accidental and never part of the official native APIs.

2 comments

But Java has interfaces for interacting with the host OS, for example you can create a file by writing `new File("myfile").createNewFile()` which makes a Linux call under the hood. Android 11 breaks that File API.
The same API on Windows does a Windows call under the hood, on IBM I does a TIMI call under the hood and on PTC bare metal it does the work itself.

Android ported to any of those platforms would still make use of File("myfile").createNewFile() with zero dependencies on a Linux implementation.

No it doesn't, the API call is still valid in Android 11, as long as the filesystem reserved for the application is used.

Even so, it has to do with the Java implementation.

It's a shame as it you can make much more powerful apps with a native API.
On modern Android Java is native both ways.

It is the main userspace programming APIs are written in. Followed by the increased use of Kotlin.

In both cases, the final execution tier does produce a pure binary, when the device is idle, after getting the PGO data from the JIT tier.

The NDK C and C++ APIs are based on ISO C, ISO C++, OpenGL, Vulkan, OpenSL (now replaced by AAudio), and Android specific native APIs.

Plenty of choice, just not Linux specific APIs.