O'Reilly logo

Hello, Android, 4th Edition by Ed Burnette

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Language Subset

Android uses a standard Java compiler to compile your source code into regular bytecodes and then translates those bytecodes into instructions to execute. Therefore, nearly the entire Java language is supported, not just a small subset. By using the stock compiler and bytecodes, you often don’t even need to have the source code for libraries that you want to use in your applications.

Language Level

Android Studio supports code compatible with Java Standard Edition 6 or earlier, with optional additions from Java 7. At present, none of the Java 8 features are available.

To enable Java 7 language features, you need to add these lines to your gradle build file:

 
compileOptions {
 
sourceCompatibility JavaVersion.VERSION_1_7
 
targetCompatibility ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required