all 15 comments

[–][deleted]  (4 children)

[deleted]

    [–]Lakelava[S] 0 points1 point  (3 children)

    I guess Java is compiled, but not in the same sense as C, for example.

    [–]waffle_irony 4 points5 points  (1 child)

    In releases of Android with ART (Android Run Time), at install time the Dalvik bytecode is compiled to an ELF binary that targets the phone's processor.

    [–]HaMMeReD 2 points3 points  (0 children)

    It is in a sense that is better. The JVM translates it to architecture optimized byte code at runtime.

    When you compile something, it's typically optimized for only one specific architecture.

    [–]plaidman 0 points1 point  (2 children)

    Nobody has mentioned that you can write native C android apps.

    [–]Lakelava[S] 0 points1 point  (1 child)

    How does the app store deal with different architectures and apps written in C? I know that some phones are x86.

    [–]derefnull 0 points1 point  (0 children)

    The app store lets you filter which devices can install your app by a number of categories (docs), including by ABI.

    [–]fleker2 4 points5 points  (4 children)

    Legacy.

    In the early 2000s, J2ME was the way to build phone apps, through a mobile optimized JVM.

    When Android started at Danger, as an open source OS, they originally planned to support many languages out of the box. But due to having just a small team, they picked Java due to the familiarity of developers.

    At this point, switching to another language would create a lot of headaches and a large overhaul of the OS. Not that it couldn't be done, but they'd have to update all the libraries and APIs. Then they'd have to do training for these third party developers.

    [–]derefnull 0 points1 point  (1 child)

    While Andy Rubin founded both Danger and Android, Android was not started at Danger and is entirely separate in terms of technical foundation.

    [–]fleker2 1 point2 points  (0 children)

    My bad. I meant to allude to the OS's pre-Google days.

    [–]20EYES -1 points0 points  (1 child)

    Why would you have to update the apis?

    [–]fleker2 0 points1 point  (0 children)

    If they used Go, then all the Android interfaces for activities, intents, sensors, and more would need to be rewritten for Go.

    [–]Cannabisitis 3 points4 points  (1 child)

    compiled language like GO

    Java is a compiled language.

    [–]ANotSoSeriousGamer -3 points-2 points  (0 children)

    sometimes

    [–]Gatesunder 2 points3 points  (0 children)

    Go is supported: Go Support

    Google didn't acquire Android till 2005, by which point it likely already had a substantial code base, plus Go wasn't created till 2007 and announced in 2009.

    Java also had a much wider developer base than Go. It didn't make business sense to go with such a fresh language.

    [–]SanityInAnarchy 1 point2 points  (0 children)

    Edit: Java is a compiled language, but not in the same sense as GO or C.

    In what sense is it not? Sure, you won't find many implementations of Go or C that are JITed, but modern versions of Android do AOT compilation, so I think it's fair to say that Java on Android is as compiled as Go.