Qt World Summit: Submit your Presentation

C++/Qt or java for Android ?

  • Hi,

    I spent day reading about programming languages and technologies and I couldn't fine a convincing nor definitive answer to my question. First of all, please, bear with me my ignorance of coding. Here is my situation, I'm a network engineer and I did code (scripting) before for couple of projects for very short time. However, as I'm in the network field, there is a great advisement on learning scripting language like Python (which has Qt cross-platform GUI framework as I read) and C++/C. Now, I got couple of ideas for Android applications (two network apps) which involves VoIP for the first app and the other is music player including some headset tricks.

    I've been told on very quick and short conversation that basically I need to learn coding for Android in Java. My question is, can I apply such functionality using c++/qt ? I know there is NDK toolset ! and qt is a cross platform GUI which run on Android fine.

    I know it seems a bit more Java vs C++ for Android apps but I'm kinda confused and I don't got a lot of free time to learn both so I joined with hope of some help or feedback from your great community since many pages I've read online of developers just taking a programming languages side !!!! And the result is me getting confused.

    Again, I apologize if the post is so .... newbie to write or to ask and I thank you in advance for kind of help or suggestion you might give.

    Regards :)

  • Moderators

    It depends what your needs/requirements are.

    Use Qt if you plan to release on multiple platforms and do not want to manage different code, or you are limited in time, share code with multiple platforms, etc.
    But a disadvantage is the resulting app package size due to Qt's libs. Which might still be a problem to download on mobile networks for some people.

    What i am saying is that, no question, Qt has it's benefits on mobile platforms. But IMHO you should always prefer the native way, because it's the way it's meant to be coded on the platform. So when the advantages of Qt prevail take it. If not go the native way.

  • @raven-worx

    First of all, thanks for replying. Well, the reason I mentioned all these details that creating the app in qt so I can learn C++ in the same process, just wanted to make sure than I can (able) to use qt in Android and if it has any disadvantages (performance, lake of supported libraries which limits the coding capabilities ... etc)!! If I'm not interested in C++ as network engineer I wouldn't ask that question. As for multiple platforms, well, I might go for it in the future but I'm not decided that yet, I need to know what I need/want first so I can order my requirements.

    So according to your reply, I can use qt after all and do the functions I want as if I used the native way !? right ?

    Again, thanks for replying I've been waiting for it :) I really appreciate it.

  • Moderators

    If you can live with the mentioned "caveats" go the Qt way when you also can benefit from the learning process in future.

    @TheNet said:

    So according to your reply, I can use qt after all and do the functions I want as if I used the native way !? right ?

    Yes you can also call the native Java API (search for "Qt JNI"). Which might be cumbersome in some situations.

  • @raven-worx

    I can't thank you enough. Really appreciate your response :)

    Best regards :)