Answer the question
In order to leave comments, you need to log in
Is there a compiler for android to binary code?
As I understand it, Java is compiled into bytecode, which is then eaten by the JVM. It turns out Java is interpreted. Are all ANDROID applications interpreted?[1] This confuses me. I want to start developing a mob. applications, cross-platform is not interested. I'm chasing speed. Is there a compiler that would compile an android application into binary code? Without the use of virtual machines. Preferably in C++.
Answer the question
In order to leave comments, you need to log in
As I understand it, Java is compiled into bytecode, which is then eaten by the JVM.
The NDK may not be appropriate for most novice Android programmers who need to use only Java code and framework APIs to develop their apps.
You have already been told about the Android NDK. I note that it is possible to write an android application entirely in C ++, without Java at all. Difficult, but possible.
Java is not interpreted. The bytecode is executed in a virtual machine, yes, but it is not an interpretation.
Then there are things like JIT(just in time) and AOT(ahead of time) compilations.
The first one compiles the bytecode into native code, on the fly, during application execution. At the same time, the JIT compiler can optimize the program based on runtime analysis.
The second compiles the bytecode into native code before execution, right during installation, if we talk about android. This takes into account the specific architecture of the device.
So you should learn some basic things first, rather than chasing speed.
Android NDK. Under it, native modules (in C / C ++) are assembled for the application, which are called from the Java application via JNI.
In fact, any application on Android cannot be without Java.
And first of all, it all depends on the type of application.
For example, this is a 3D game - it needs speed (especially without the intervention of the garbage collector), and things from the SDK are not particularly needed (but you can still refer to them). To do this, almost everything can be done on the NDK side
And if a regular application with lists, buttons, .., then all this should be done in Java, and only separate resource-intensive parts should be transferred to the NDK, otherwise the development process can drag on for a long time, which is simply pointless with a 10% increase in performance (well, let lists there will be faster to form and render) and significantly increased development time
Notes:
Java is not interpreted, as it is compiled into bytecode during assembly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question