Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why did Google choose Java for the Android Operating System? [closed]

Full question

Why did Google choose Java for the Android Operating System and not the X language?

Where X would be one of the below:

  • Python version 2.7 or version 3
    • which is equally as powerful as Java
    • has a lot of useful third party libraries
    • is faster to develop in thanks to it's dynamic nature
  • C/C++ or ObjC
    • which are harder to develop in but
    • run faster thanks to less overhead
    • would require less beefy hardware, especially RAM
    • are equally as robust as Java but are more prone to app-wide crashes when just one module fails

And so on. My main concern when I asked this question was why Java and not Python. I can add other elements (languages) of comparison later if anyone else is also interested.

Info: I'm not a full-blown developer.

EDIT I was very much aware that my question was going to be met with some opposition and bashing, that's why I said that I'm not a full-blown developer. I have my personal opinions to support me and just that but even thus, I still got great answers. I understand now, yes, Dalvik VM runs Java bytecodes on ARM devices, but how different is that Java from any other Oracle/Sun Java spec, I don't know. I've been playing with both Java and Python and wrote at least one useful program in both + GUIs (Swing and PySide) and at least one third party library used. The order I did this was Java, then Python which made me realize how much faster it was for me to write everything from scratch in Python than it was in Java. Even packages seemed much easier to manager than Java's way of importing packages (thank God for Eclipse and a few intuitive clicks)... and then how complex would embedded apps be that you'd need to take extra care for type checking and unit tests (and afaik, unit tests are supposed to be a must nowadays for any serious developer)... but anyway, thanks for the answers so far. It's a learning process. ;)

like image 326
Paul-Sebastian Manole Avatar asked Sep 21 '11 09:09

Paul-Sebastian Manole


People also ask

Why does Android still use Java?

JAVA gives the best option for development of mobile applications that are based on Android, as Android consist of its own APIs and JAVA libraries. So, for Android applications, you use android APIs as well as JAVA to write code for Android apps.

Will Google remove Java from Android?

Now, Google has confirmed that it will be doing away with all the standard Java APIs in the next version of Android. Instead, it will use only the open source OpenJDK. The ongoing battle between Oracle and Google has been messy, to say the least.

Why do phones use Java?

Why use Java for mobile development? Java is a versatile and powerful programming language that can be used for developing a wide range of applications. It is platform-independent, which means it can be run on any platform, including Android and iOS.

How does Google use Java?

Google uses the Java programming language to build and develop the Google Docs applications. The user's side of the system -- what would be called the client side in a traditional network -- consists of Web applications enhanced by the Javascript programming language. Javascript and Java aren't the same thing.


2 Answers

According to Google:

We've been over a bunch of [alternatives to Java], and think they all suck. We conclude that we need to negotiate a license for Java under the terms we need. Source

It's not a particularly descriptive why, but it's about as good as you'll get from Google, I'd imagine.

like image 158
Gareth Latty Avatar answered Oct 24 '22 07:10

Gareth Latty


  • Google, as a company, uses Java a lot. The search features are written in Java. As far as I can tell from the outside, Google likes Java.

  • For most tasks, Java is faster than Python. I would rather work in Python, and I know how to write reasonably efficient Python, and yes PyPy is really shaking things up, but Google needed to provide a snappy experience on relatively underpowered phone processors so they likely didn't consider Python a contender.

  • Java, like Python, provides a great deal of isolation from details of the underlying hardware. I think all Android phones are ARM-based, but in theory you could make an Android phone based on an x86 chip or something completely different, and as long as you do a good job of porting the Dalvik VM, your code will run. (Aside from apps that have native ARM code compiled in, of course.)

Google likes the Java language, but they chose to write their own VM ("Dalvik") rather than license the Java VM. Compiled Java can be directly translated into Dalvik bytecodes. (Oracle sued Google over this. Oracle lost the lawsuit.)

like image 35
steveha Avatar answered Oct 24 '22 08:10

steveha