Hello, I recently became interested in programming for android, and I had a question about what is better (in terms of performance).

  1. Write in Java (using SDK and standard Android versions).
  2. Write in C ++ (QT) and compile for android.

Who faced this answer that it is better, it is desirable to argue.

  • I did not hear that qt was supported by android. Although there you can write on the NDK, but again not sure whether you can write a ready-made application exclusively on the NDK — rather, there you can only write individual files and then integrate them with Java. - LackOfKnowledge
  • Hear: habrahabr.ru/blogs/mobiledev/125845 It would be something to compare, for example 2gis, I think that a bunch of Java + JNI will work faster than Qt. - kENNAAAAA
  • Thanks for the answer, is it possible to use QT only to draw the GUI? The rest of the application is sdk and ndk. - username76
  • How do you imagine that? - kENNAAAAA
  • Bad, so I ask. - username76

4 answers 4

  1. Developer time is expensive.
  2. 80% of the code consumes 20% of resources and vice versa.

From this it follows directly that it is necessary to engage in optimization when it is impossible to do without it. If you are not limited by anything and do not force you to write on C / C ++ for Android (usually these are old libraries that have been written for a long time and will be more expensive to rewrite them in Java), then you should write in Java. In terms of performance, it is important to rewrite in C / C ++ only the part that is actually a resource.

PS For Qt for Android there is a port: Necessitas . But this is an additional artificial layer, and its use will almost always be to the detriment of the result.

    A more or less common pattern of development for Android is to write under Java, then , if necessary, critical parts of the code in terms of performance should be written under C / C ++

    I advise you to follow this approach, otherwise product development will be too expensive.

      Android can only be written on jave. And it is really very slow. For acceleration, you can use NDK. It allows jave to use libraries written in c ++.

        Only under Android to write on QT there is no point. It makes sense to consider QT only in the case of cross-platform development, for example, write directly under Android / iOS / WP or use the ready-made functionality of the desktop QT application.

        But in this case it is also necessary to carefully weigh the pros and cons.