Android N is Saying Goodbye to Oracle’s Proprietary Java APIs

Google has announced to move away from Orcale’s proprietary Java Application Programming Interfaces (APIs). In the next version of their operating system, Android N, the new standard will be OpenJDK, an open source alternative.

It all started last month with a “mysterious Android codebase commit”  which shows 8,902 files were changed, clearly notes OpenJDK code was added to Android:

Initial import of OpenJdk files.
Create new libcore/ojluni directory with src/main/java and src/main/native subdirectiories.
Build ojluni into core-oj jar.
Use openjdk classes from java.awt.font package.
Copy all files from jdk/src/share/classes and jdk/src/solaris/classes directories in openjdk into libcore/ojluni/src/main/java.
Copy following native files from openjdk to libcore/ojluni/src/main/native: [long list of files]

I largely suspect it has a lot to do with Oracle vs Google case in which Oracle, which only bought Java a few months ago from Sun Microsystems, claimed Android has copied Java’s source code in their operating system. To anyone who didn’t follow the case, the main code in question was just a few lines written by a guy at Google who previously used to work at Sun on Java. That’s right. He wrote the code in both cases (among thousands of lines of code he wrote on both projects) and it happened to be the same on a few lines by the same guy (Joshua Bloch). Out of millions of lines, this was it:

private static void rangeCheck(int arrayLen, int fromIndex, int toIndex) { 
    if (fromIndex > toIndex) 
        throw new IllegalArgumentException("fromIndex(" + 
             fromIndex + ") > toIndex(" + toIndex+")"); 
    if (fromIndex < 0) 
        throw new ArrayIndexOutOfBoundsException(fromIndex); 
    if (toIndex > arrayLen) 
        throw new ArrayIndexOutOfBoundsException(toIndex); 
}

So what does it mean for 1.4 billion end users? Well, nothing. For them, Android will continue to work as it does and responsibility will lie on developers to make some minute changes to their apps.

A Google’s spokesperson said the following on this topic

As an open-source platform, Android is built upon the collaboration of the open-source community. In our upcoming release of Android, we plan to move Android’s Java language libraries to an OpenJDK-based approach, creating a common code base for developers to build apps and services. Google has long worked with and contributed to the OpenJDK community, and we look forward to making even more contributions to the OpenJDK project in the future.

Although, the case isn’t over and the final decision will still be watched very closely as it could have a huge impact on software development as a whole. If Oracle wins, tech giants could hold a lot of power over developers creating new software based on existing services and APIs. If Google wins, fair use laws could essentially protect the use of APIs for developers around the world.

Basit Saeed

Passionately a software developer, Basit Saeed considers himself a person who believes in software and social media being the change agents of 21st century. He is a techy, a gadgets freak, and loves playing with code whenever he can. He tweets at @basit_saeed.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s