I wrote some simple apps in Android using Java.
But later I found this:
It provides headers and libraries that allow you to build activities, hand
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.
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.
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.
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.
Re-writing one of those "self-contained, CPU-intensive operations that don't allocate much memory" in C may improve the performance/battery life by a factor of 17 according to this investigation. This article finds that running CCTOOLS Fortran is even quicker. So alternative languages are well worth considering.
For CPU intensive applications such as, Computer Graphic apps, Games, Simulations, AI/SI, Digital Image Processing, or Computer Vision, go for C/C++. If you're building a small application that only deals with data (JSON, XML), the representation of it, or small graphics apps (board games, retro games during the 90s), then JAVA is enough.