+ 5
Can i make android apps by using "C++"
3 Answers
+ 11
Through the use of Android NDK.
https://developer.android.com/ndk/index.html
+ 5
thank you @hatsy rei
+ 1
Advantages of C++ over Java
Java is an excellent language, but for Android mobile development, C++ has a few advantages. These include a smaller memory footprint, as C++ is nearer the metal and has no garbage collection.
C++ is a superset of C and should compile virtually all C programs, so you could reuse C software. Then thereâs the speed issue: itâs often claimed that Java programs can run as fast as C++, and in some cases faster. While Iâve no reason to doubt it (see the section above about JVM), you may need to tweak your Java code to get that level of performance.
Java source code is compiled to bytecode and stored in .jar files, which are zip files. At runtime, the JVM loads the .jar file bytecode and compiles it to machine code. This is JIT: Just-In-Time Compilation.
Compare that to C++, which has no âwarm upâ time. For that reason, at least in my experience, C++ applications always feel a little snappier than Java (or C#) on the same hardware.
The code below is from the NDK Reference for NativeActivity; itâs the first part of initializing the activity for writing to the OpenGL screen: