Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a C, C++ developer. I am interested in mobile development. I want to know how can I develop Android apps using C and C++, I have read that they are providing a kit for C, C++ developers but it does not have all functions as of Java kit. Should I go for C/C++ development kit or it's better to learn java as they may not provide all the functionality in future?

share|improve this question

closed as off-topic by Bart van Ingen Schenau, jwenting, amon, ChrisF Oct 19 '14 at 10:51

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about what language, technology, or project one should take up next are off topic on Programmers, as they can only attract subjective opinions for answers. There are too many individual factors behind the question to create answers that will have lasting value. You may be able to get help in The Whiteboard, our chat room." – Bart van Ingen Schenau, amon, ChrisF
If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 29 down vote accepted

Short version : working with C++ on Android is possible and easier with each Android SDK/NDK version, but it's harder than working with Java.

Long version :

For each version, Google adds more functionalities to Android Native Development Kit and makes it more and more independant on the Java code.

Read for more details:

Write a native activity, which allows you to implement the lifecycle callbacks in native code. The Android SDK provides the NativeActivity class, which is a convenience class that notifies your native code of any activity lifecycle callbacks (onCreate(), onPause(), onResume(), etc). You can implement the callbacks in your native code to handle these events when they occur. Applications that use native activities must be run on Android 2.3 (API Level 9) or later. You cannot access features such as Services and Content Providers natively, so if you want to use them or any other framework API, you can still write JNI code to do so.

The problem is just that if you use the most recent NDK, you'll not be able to deploy and a lot of not-recent Android versions.

Anyway even with previous NDK versions, you can have minimal Java code (for interacting with the OS) and the full application code in C++ or anything native.

There are also efforts in helping native developers to work fully in C or C++ via IDE plugins like this Vs-Android that is a plugin for Visual Studio 201x hiding all the compilation and generation process from you :

Also, if you plan do port your application to other OS, going with C++ for the core of your application (maybe with a scripting language on top) is a good idea. It's just more expensive on development time than other alternatives - for reasons specific to C++ and it's available dev tools implementations, for example too much compilation times can kill your effective productivity.

That being said, that is not the most easy way to work on mobile apps.

share|improve this answer

I would advise you to go for C++ if you have a firm plan to go into Game Development. But if not, you better go for Java. Here is a good primer for you on the official android website:

Game Development for Android: A Quick Primer

NOTE: Please do read step 2 (Step Two: Pick a Language) of the tutorial.

If you do not know Java at all and like to develop apps on Android for the long term, it is essential to learn Java. There are great tutorials given on the official website. There is a nice book that you can grab for learning specifically for Android development: Here it is: Learn Java for Android Development

share|improve this answer
The person who posted the question already knows C++, so what's the point of your advice? – abhi Dec 30 '11 at 16:31
Agreed. Just edited my answer. Thanks – Maxood Dec 30 '11 at 16:49

Should I go for C/C++ development kit or it's better to learn java as they may not provide all the functionality in future?

The answer is both.

  • If you are writing any applications where performance is a main concern, they almost have to be in something other than java. (C/C++ is most popular) Games is the big ticket item, but there are others.
  • If you are doing any android development, you should also take the time to learn java to a reasonable level.
share|improve this answer

protected by Thomas Owens Feb 21 '14 at 13:11

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.