Saturday, 24 February 2018

Lambda integration on Android

Lambda was introduced on Java 8 and it simplifies the code by removing some boilerplates. To use it. Do the follow:
1. Make sure you have Java 8 installed
2. Add the following code to your build.gradle file of the app, under the section of  "android"

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8

3. Make sure you are using the version 3.0 or higher of android build tool for gradle.

TutsPlus - Java 8 for Android: Cleaner code with Lambda Expressions

No comments:

Post a Comment