The official Java 8 announcement for Android N Preview says the following:
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. (…) Some Java 8 language features — like default and static methods, streams, and functional interfaces — are also now available on N and above.
I'm using the following gradle configuration with minSdkVersion 15
to try some Java 8 in a small project:
android {
compileSdkVersion 'android-N'
buildToolsVersion '24.0.0 rc1'
defaultConfig {
applicationId "org.sergiiz.thermometer"
minSdkVersion 15
targetSdkVersion 'N'
versionCode 1
versionName "1.0"
jackOptions{
enabled true
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
//...
}
But the Deployment Target selector shows minSdk(API23, N preview)
. Is it expected behaviour?
Is there a list of Java 8 features/packages available as far back as Gingerbread and do you know which gradle settings or support libs are needed to use Java 8 features on API<23?