5 ms·
It's the exact same situation as in native code Just to be clear, Android applications can be, and often are, 100% DEX (the vast majority of productivity, vide
by personZ 12y ago
It's the exact same situation as in native code
Just to be clear, Android applications can be, and often are, 100% DEX (the vast majority of productivity, video, etc). Because, you hold, there are exception applications that break this model, the whole model is broken? It's saying that the web is broken because ActiveX is used somewhere.
That is horribly specious. It is a dead-end argument by exception.
But let's look at those uncommon apps that use some native code.
a) The majority of the code in most cases will still be in DEX. It will still benefit from device specific compilation.
b) The majority of the NDK code will or should have Java equivalents. When the native code can't be used, DEX code will be used. Again, this is idiomatic.
c) And when those two aren't true, on x86 for instance if you only include ARM, it simply transcodes the ARM native code to x86 native code. It obviously isn't optimized, but it's a pretty decent exception case.
In every case you benefit from the device specific compilation. So what doesn't hold again?
- pcwalton 12y ago> But let's look at those uncommon apps that use some native code. Games are not exactly uncommon apps: https://play.google.com/store/apps/collection/topgrossing?hl=en https://play.google.com/store/apps/collection/topgrossing?hl... > a) The majority of the code in most cases will still be in DEX. It will still benefit from device specific compilation. Do games really bother to ship Java equivalents? I would be really surprised if they did. > c) And when those two aren't true, on x86 for instance if you only include ARM, it simply transcodes the ARM native code to x86 native code. It obviously isn't optimized, but it's a pretty decent exception case. Yes, you can use emulators for native code too, but that's hardly a good user experience unless the games are old.