News for hackers. Stuff that matters.
Re:First Preview of Android N: Developer APIs and Tools by ubertaco on Wednesday March 09, 2016 @01:36PM (#11254783)
Woah:

>Improved Java 8 language support - We’re excited to bring Java 8 language features to Android. With Android's Jack compiler, you can now use many popular Java 8 language features, including lambdas and more, on Android versions as far back as Gingerbread. The new features help reduce boilerplate code. For example, lambdas can replace anonymous inner classes when providing event listeners. Some Java 8 language features --like default and static methods, streams, and functional interfaces -- are also now available on N and above. With Jack, we’re looking forward to tracking the Java language more closely while maintaining backward compatibility.

Re:First Preview of Android N: Developer APIs and Tools by V-2 on Wednesday March 09, 2016 @05:03PM (#11256040)
While it's certainly a change for the better, personally I find the Streams API is still clunky and lacking. In compare to LINQ, or Kotlin (case in point: http://stackoverflow.com/a/34642255).
Re:First Preview of Android N: Developer APIs and Tools by joelhaasnoot on Wednesday March 09, 2016 @03:13PM (#11255452)
I find the fact that streams and functional interfaces are not backwards compatible almost a deal breaker. Using Java 8 streams makes so many things easier that once you start using it, there's no going back. Now you're not going to be able to use it in production till 2019.
Re:First Preview of Android N: Developer APIs and Tools by richdougherty on Wednesday March 09, 2016 @03:51PM (#11255651)
When you say "not backwards compatible" do you mean that the streams and functional interfaces aren't compatible with Java in Android N or do you mean that they're not being to be ported to previous versions of Android?
Re:First Preview of Android N: Developer APIs and Tools by pas on Wednesday March 09, 2016 @08:38PM (#11256925)
Maybe in general, Java 8 generated bytecode won't run on earlier JVMs, but a lot of shops are still on Java 6/7. (Allegedly.)
Re:First Preview of Android N: Developer APIs and Tools by joelhaasnoot on Saturday March 12, 2016 @10:18AM (#11273137)
As I understood the article, it seems they're not being ported to previous versions of Android.
Re:First Preview of Android N: Developer APIs and Tools by RivieraKid on Wednesday March 09, 2016 @02:38PM (#11255229)
This has been possible for some time with retrolambda.
Re:First Preview of Android N: Developer APIs and Tools by EddieRingle on Wednesday March 09, 2016 @02:41PM (#11255255)
In fact, they've implemented lambdas exactly like retrolambda does via anonymous classes.
Re:First Preview of Android N: Developer APIs and Tools by sparky_ on Wednesday March 09, 2016 @03:10PM (#11255438)
So this is just another way to blow up your dex method count?
Re:First Preview of Android N: Developer APIs and Tools by lukasb on Wednesday March 09, 2016 @04:45PM (#11255953)
disclaimer: I work on Android dev tools

It depends. For example, let's compare providing an event listener via a lambda vs an anonymous inner class. Using the lambda will increase your method count by 1. However, if you're accessing class member variables, it will reduce the method count for each variable you use, because it's added as a method of the containing class and doesn't need to generate accessors.