4 ms·
C# can be natively compiled, doesn't it?
by tommyage 4y ago
C# can be natively compiled, doesn't it?
- invalidname 4y agoCodename One lets you do that with Java. Even more so since native on Android is Java...
- michaelmior 4y agoI'm not sure I would say Java is native on Android. Sure, most Android apps run on the JVM, but it's not strictly necessary. Google has even released a Native Development Kit that lets you write code in C/C++. https://developer.android.com/ndk/ https://developer.android.com/ndk/
- invalidname 4y agoThis works through JNI. It will work fine as long as you don't use Java/Kotlin stuff. Then you will need to traverse back into the running VM. That has a serious overhead of going in/out of the VM. Since the Android UI is built in Java C code that tries to work with it is slower. Notice that this isn't true for games which interact with the hardware directly in C. Only for high level UI stuff.
- michaelmior 4y agoSure. My point is, the hardware is not directly executing Java bytecode, so I don't think I would say Java is native to Android in the traditional sense of the word. Google themselves make the distinction between Java code and native code.