Take the 2-minute tour ×

I wrote some simple apps in Android using Java.
But later I found this:


How is it related to this:

Android applications are written in the Java programming language. (Source)

Are all three languages possible?
Sorry for the dumb question.

share|improve this question
add comment

5 Answers

up vote 19 down vote accepted

The article you link to has good information. It also links to http://developer.android.com/sdk/ndk/overview.html which says:

The NDK will not benefit most applications. As a developer, you need to balance its benefits against its drawbacks; notably, using native code does not result in an automatic performance increase, but always increases application complexity. In general, you should only use native code if it is essential to your application, not just because you prefer to program in C/C++.

Typical good candidates for the NDK are self-contained, CPU-intensive operations that don't allocate much memory, such as signal processing, physics simulation, and so on. Simply re-coding a method to run in C usually does not result in a large performance increase. When examining whether or not you should develop in native code, think about your requirements and see if the Android framework APIs provide the functionality that you need. The NDK can, however, can be an effective way to reuse a large corpus of existing C/C++ code.

share|improve this answer
add comment

Java always allows you to call "native code" components. However, you want to avoid them if possible because they can introduce subtle bugs and platform dependencies into your code.

I don't believe you can code a whole application for Android in C/C++ however -- you must have a Java wrapper at the very least.

share|improve this answer
add comment

Android is Linux underneath so you can run any language on it. I have run Perl scripts on an Android phone for fun. From a practical, application development point-of-view, Google's implementation of Java running on Dalvik would be the typical route to take.

share|improve this answer
add comment

This is good question, AFAIK, c or c++ comes into picture when you really want to program something core dalvik feature than using Android API as specified you question, something like sensor related features or hardware.

If you want build app using API, it will be mostly in Java/XML.

share|improve this answer
Dalvik is mostly written in c++, but working on the JVM does not really equal writing applications for android. The c++ api is much more limited than the java one - I'm not even sure there exists a native API for the sensors.. there obviously is one for Java though. –  Voo Jan 17 '12 at 21:07
add comment

Java is better overall for android but you can see Lua too ;)

share|improve this answer
add comment

Your Answer


