Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java 7 / 8 in Android? [closed]

Tags:

java

android

Android is great mobile platform, it uses Java (for a good reason) a really popular programming language. But the Java language is evolving, moving forward, the version 7 with small language improvements has some years and the next year it comes the version 8 with the awaited lambdas.

My question is: Will Android run Java 7 or 8 or take some of their constructs?

UPDATE: Just for non believers: In Android Kitkat 4.4 we can use Java 7 goodies: ARM, switch over strings, diamond,etc. Yeah! I hope that it will not take so longer to get lambdas and Java 8 features

like image 684
Nestor Hernandez Loli Avatar asked Jan 12 '23 17:01

Nestor Hernandez Loli


1 Answers

Android works today with Java 7, according to the tools team, though I have not tried it personally just yet. By this, I mean that you can compile an Android project with a Java 7 compiler, and the build tools will accept the Java 7 compiler output. AFAIK, there was only one new bytecode added (invokedynamic, or something like that), which is for interpreters, not the javac compiler.

Since Java 8 does not exist in final form, and since Google does not tend to give out future details like this (particularly given in-flight litigation), you will know when the rest of us know, sometime after Java 8 ships.

like image 55
CommonsWare Avatar answered Jan 17 '23 17:01

CommonsWare