简体   繁体   English

使用JAVA 8进行Android开发是一个好习惯吗?

[英]Is it a good practice to use JAVA 8 for android development?

I read the instructions for using Java8 for android development from this answer and ( orfjackal/retrolambda ). 我从这个答案和( orfjackal / retrolambda )阅读了使用Java8进行android开发的说明。

I wanted to know if it is a good practice to use this technique to implement Java 8. Does this affects the application performance ? 我想知道使用这种技术实现Java 8是否是一个好习惯 。这会影响应用程序性能吗?

It is mentioned in the blog - retrolambda It does this by transforming your Java 8 compiled bytecode so that it can run on an older Java runtime. 它在博客中提到 - retrolambda 它通过转换Java 8编译的字节码来实现这一点,以便它可以在较旧的Java运行时上运行。

I think it is too early to say that use Java 8 is a good practice for android development, officially android needs the Java 6 JDK as mentioned at the bottom of this page: https://developer.android.com/sdk/installing/installing-adt.html 我认为现在说使用Java 8是Android开发的一个好习惯还为时尚早,正式android需要本页底部提到的Java 6 JDK: https//developer.android.com/sdk/installing/安装-adt.html

Also, there are some Android APIs that even not support try with resources, so I don't think they'll support Java 8 at all. 此外,还有一些Android API甚至不支持尝试使用资源,因此我认为它们根本不支持Java 8。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM