Is it possible to create a C/C++ app for Android?

Asked

Viewed 11,213 times

9

I want to create an application for Android using the C or C++ language. What are the advantages and disadvantages of this?

  • 2

    Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful to you. You can also vote on any question or answer you find useful on the entire site.

2 answers

15

Yes, it is possible, There is something called NDK (fantastic translator used on this site, translated up the code :) ).

  • Obviously you will have more performance
  • eventually be better or easier to do some specific things
  • has much more control over the memory, can avoid the Garbage Collector
  • can use desired libraries in these languages directly
  • maybe you’re using a language that’s more comfortable.

If you think of anything else I put on.

  • It’s harder to program in these languages, it’s easy to make more mistakes and create insecurity, it’s less productive
  • is not the main language, need to interoperate with the Android JVM
  • some things from Android are harder to use with NDK.

Here’s a kick, go to Java or C#, even if you say little I can infer that is the most suitable way for your case :)

  • At this moment I need to program in c++, java I don’t quite know yet ...I need to create an APP for each language I study ...

2

Well, for normal applications I do not see advantages, so much so that I knew ndk I thought it was possible to create applications 100% in C/C++, but it is not so much so that something that eluded me the most was the fact that there are native views in the style findViewById picking up by xml, recommend to use for applications that need performance as an emulator or a game, in this case you will be able to create in 98% pure C/C++ .

Browser other questions tagged

You are not signed in. Login or sign up in order to post.