Is it necessary to use only "Java" for creating an android application? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Is it necessary to use only "Java" for creating an android application?

C++ is faster and Python looks easier. But everyone recommends Java for creating an android software. Is it necessary to use only Java for android? And what are the drawbacks of using other languages such as c++, Python and Ruby?

25th Feb 2018, 10:08 AM
Syed Riyaz Uddin
Syed Riyaz Uddin - avatar
2 Answers
+ 17
Java has an already implemented universum of Android-related libraries. This is why it is easier to build apps in it. But theoretically and practically you can build applications in other languages, too. For example, Python's kivy module or sl4a (scripting layer for Android) are capable of building an .apk
25th Feb 2018, 10:11 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 2
The Android environment is designed to run a JVM-like executable (called "dalvik", using .dex files). Any language that generates normal JVM (JAR) files can be used, e.g. Java, Kotlin, or other JVM languages. https://github.com/dogriffiths/HeadFirstAndroid/wiki/How-Android-Apps-are-Built-and-Run (before 5.0 dalvik was run directly, and later they compiled dalvik executables to native code after app install). Technically you cannot take a native x86 or ARM binary executable and run it on android. Yoy can use C++ but only as a library called from a wrapper java code. Even react-native runs on android by using a java part rendering the GUI and a javascript engine that runs the rest.
25th Feb 2018, 11:55 AM
Udi Finkelstein
Udi Finkelstein - avatar