C++ or Java for android?
Solution 1
Pick the right tool for the job. The right tool for android is java, and occasionally c++ if it's really needed. Android runs on several different CPUs, and you'd be required to deal with fun stuff like compiling for platforms that you can't really test on - at least if you want to make apps for anyone but yourself.
Solution 2
It's all dependent on what you want to do, but the general rule of thumb:
C++ is for speed (for example games).
Java is for UI and general Android programming.
Solution 3
You cannot code an entire Android application using only C++, the android SDK is written in Java and that is what you will have to use.
This said you can still use C++ for heavy stuff.
BigPete
Updated on July 11, 2022Comments
-
BigPete almost 2 years
I am thinking about picking up android development in my free time. I see that development is possible in Java and C++ but the latter is limited.
I am much more comfortable with C++.
So my question is what limitations exist with C++ on Android? Will I be able to develop full apps with it, or will I eventually have to learn Java?
-
Leif Andersen almost 13 yearsThis is not entirely true. With android 2.3+, and the ndk r5, you can build an entirely native android app. developer.android.com/sdk/ndk/index.html
-
Jakub M. over 12 yearsMaybe a stupid question, but... as both Java and C will be run on the same virtual machine, will C have significant speed boost over Java here?
-
mcsilvio about 10 yearsI thought the C++ code was run directly (not through the JVM).