4

I read the instructions for using Java8 for android development from this answer and (orfjackal/retrolambda).

I wanted to know if it is a good practice to use this technique to implement Java 8. Does this affects the application performance?

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.

Community
  • 1
  • 1
harsh_v
  • 3,193
  • 3
  • 34
  • 53
  • Unless this is some contract for a huge project, it doesn't really matter. Just use whatever java you want. – takendarkk Aug 12 '15 at 11:48
  • Thanks for the help @Takendarkk. I think what you are saying is true. I will use it and see if it is stable enough for my application. Might not make huge difference but i hope it will certainly not reduce the application performance (*if i use properly*). – harsh_v Aug 12 '15 at 20:06
  • 1
    @Harsh I used `retrolambda` it is working fine in android. Use java 8 stream library if you using some Java 8 APIs. – Anand Singh Aug 13 '15 at 05:49
  • I've had the same question when I came to an existing Android project production that used Java 8. Now, 9 months later and no problems, I feel a lot better about using Java 8 in Android. – Alex Bravo Sep 27 '15 at 19:19

1 Answers1

0

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

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.

arodriguezdonaire
  • 5,396
  • 1
  • 26
  • 50