2

The reason Andy Rubin chose Java for Android Dev is not publicly known, only speculations, but it seems to me that the combination of being able to run a Java app everywhere (because the earliest version of Android used JVM) and the huge popularity of Java made it a sexy choice.

Android Run Time (ART) is the second Iteration of Java Virtual Machine after Dalvik Virtual Machine.

Obviously, Write once, run everywhere, which Java promised is not True on Android due to the highly modified JVM == ART.

My question is this: since apps written for Android are not portable (i.e the apps are platform dependent), why still hold on to it?

Why convert to bytecode before running it on ART and not just compile to native code directly without the need for an interpreter (ART) like in the case of Apple's Swift?

Why tolerate the performance loss just for ART? an iPhone App on 4gb ram will perform better than the same app on Android with 6gb of RAM due to the absence of the possibly unnecessary ART layer.

In 2019 and beyond why is the ART necessary?

8
  • 3
    There is one simple answer: Apple supports ~20 different device (all Apple). Google supports several thousand devices with different CPU platforms (ARMv6, ARMv7, ARMv8, x86, x86_64) and concrete implementations (MTK, Kirin, Exynos, Atom, ...). Precompiling would waste a lot of potential on the different platforms. Anyway Huawei has developed such a system. Read the details on XDA.
    – Robert
    Jul 4, 2019 at 9:48
  • @Robert good reason. But then NDK shouldn't be in Android's development suite so that none of app developers' potential is wasted in compiling platform-specific libraries. Or are you talking about the potential wasted in building "all native" ROMs (by individuals or OEMs)? Jul 4, 2019 at 10:27
  • 2
    @Irfan: Google provides what is demanded - there is no "the only correct way". Every programmer has a bit different preferences. The NDK allows you to reuse existing native libraries. This can save thousand of programmer hours by being able to use an already existing library. Especially for games this this very important.
    – Robert
    Jul 4, 2019 at 10:58
  • Thanks, @Robert for your answer. Is there a written document that explicitly states the CPU architectures android supports? You should write your comment as an answer. Thanks
    – LekeOpe
    Jul 10, 2019 at 8:48
  • @Robert what do you mean by "Precompiling would waste a lot of potential on the different platforms" Please expatiate.
    – LekeOpe
    Jul 10, 2019 at 11:17

0

You must log in to answer this question.

Browse other questions tagged .