Is it possible to use only Java (without C++ /NDK) for building good, fast, beautiful Android apps (including 3D development)?
When I look for Android developer position requirements (vacancies), I see that knowledge of C/C++/NDK is very important. Some companies even require to build their test tasks using only C++ (OpenGL).
2
In most cases you do not need c/c++ to develop for android.
According to Android NDK Overview
II. Android NDK Non-Goals:
The NDK is not a good way to write generic native code that runs on Android devices. In particular, your applications should still be written in the Java programming language, handle Android system events appropriately to avoid the “Application Not Responding” dialog or deal with the Android application life-cycle.
however c/c++ is important if you want to use existing c/c++ libraries.
Example: Android has no build-in mp3 encoder but you can use opensource lame library.
The same might apply to 3d-imageprocessing
4
There are many applications in Java. Development in Java is faster and the devices are so powerful these days that efficiency does not matter when the application is mainly cool user interface for some data pulled off the net. Which is majority of applications out there. So you can certainly get a job in Android application development even without C++ knowledge.
There are however several very good reasons to choose C++ for more complex applications:
- To this day C++ is still the only language portable to all platforms. Some mobile platforms have Java, some have CLI/CLR (.NET), but neither is available on all of them. Writing portable application in C++ is a lot of work, but is doable and proven by many examples.
- Java has memory inefficiency built into the language. If you look at various comparisons, similar task usually takes 3-10 times more memory in Java than in C++. So if you are doing something that needs lot of data in memory, Java would not be good choice (note that situation is much better with CLI/CLR).
- Dalvik, the JVM on Android, is quite a bit behind the best of breed JVMs like HotSpot. So if you are doing something that really needs raw computing power, Java is not a good choice on Android. There are however very few applications that actually need that much power. Most applications just sit there and twiddle their thumbs 99% of time waiting for user to click something and for that kind of applications Java is fine (for most of them even Python would be fine).
I think the first reason is by far the most important.
2
It depends on how ‘native’ your apps are expected to go. It seems that for now, many apps need to be native in order to give the full Ux/UI that end users demand. Will the HTML5 & Java based API abstraction become good enough to not need this going forwards? Who knows 🙂
It works perfectly when modifying for C/C++ code, but when java code is modified it does not automatically rebuild it. Java modifications are not send to emulator or device.