Java 7/8 on Android?

Android is a great mobile platform, it uses Java (for good reason) a very popular programming language. But the Java language is developing, moving forward, version 7 with minor language improvements has several years, and next year comes version 8 with the expected lambdas.

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

UPDATE: Only for non-believers: in Android Kitkat 4.4 we can use the advantages of Java 7: ARM, line switching, diamond, etc. Yes! I hope it doesn't take longer to get lambdas and Java 8 features.

+4
source share
1 answer

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

Since Java 8 does not exist in its final form, and since Google has no tendency to produce future data like this (in particular, in a lawsuit in flight), you will know when everyone else knows, sometime after Java 8 is sent.

+9
source

Source: https://habr.com/ru/post/1495820/


All Articles