3 ms·
I wonder if it would make sense to rewrite some native components of Android in Java now. Presumably, whole-program optimization means that the ART compiler is
by mwcampbell 12y ago
I wonder if it would make sense to rewrite some native components of Android in Java now. Presumably, whole-program optimization means that the ART compiler is more effective if more of the code is in Java (or technically, Dex bytecode) rather than having opaque native parts with JNI overhead.
- DiabloD3 12y agoA lot of Android is written in Java already. What would be interesting, however, is Android transitioning to a message passing micro-kernel (instead of Linux) and writing as much as possible of the rest of the kernel in Java.
- pjmlp 12y agoThat is already the case. When you look at the NDK, you can only have access to game related API (audio, graphics and sensors) almost everything else involves JNI.
- jordanthoms 12y agoActually quite a bit of the view code is native still - start reading the source for View etc and you hit a level where it's mostly calls out to native libraries. e.g https://github.com/android/platform_frameworks_base/blob/master/core/java/android/view/GLES20Canvas.java https://github.com/android/platform_frameworks_base/blob/mas...
- pjmlp 12y agoWell, graphics code eventually needs to speak to the graphics card. I imagine outside graphics, audio and hardware integration APIs, there is very little done at C level.