Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
What are the differences while using java or qt for creating an android application?
java use Dalvik virtual machine , does qt code use a virtual machine too, or just compiling the code?
what about the speed of the program?
and why google choose java for supporting android?
Posted

1 solution

Before KitKat...
Google choose Java because of its popularity and the mass open source tool support Java development. The second reason is that Java uses Java byte code and for that no need to recompile it for every phone, but it can be run a virtual machine (JVM - Java Virtual Machine).
Google later created the Dalvik Virtual Machine (DVM) which is similar to JVM but designed to run on machines with low resources (memory, speed).
After KitKat...
With KitKat Google introduced the Android Runtime that replaces DVM. The idea is that at the installation time the Java byte code is compiled (using what called ahead of time compiler) to machine code and that machine specific code is actually installed on the system...

If you use Java to develop for Android you will run your application directly on the API layer of Android, while running Qt (which is C based and for that not directly supported on Android) you introduce and other layer - that of the Qt common libraries...
In most cases the performance will not be an issue and it must be examined in the context of your specific application...
 
Share this answer
 
Comments
Kasra Ahmadi 21-Sep-14 12:29pm    
java create bytecode and then send these bytecodes to DVM. how about qt code? does it have any connection between DVM?
Kornfeld Eliyahu Peter 21-Sep-14 12:33pm    
No. It runs on the top the Qt stack, that implemented machine specific...
And no DVM after KitKat at all!!! No for even Java!
Kasra Ahmadi 21-Sep-14 12:36pm    
user can select to use DVM or ART ... take a look at this http://www.extremetech.com/computing/170677-android-art-google-finally-moves-to-replace-dalvik-to-boost-performance-and-battery-life
Kornfeld Eliyahu Peter 21-Sep-14 12:43pm    
Now. But not AFTER KitKat!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900