1 page.title=Java 8 2 page.keywords="android N", "Java 8", "Jack" 3 @jd:body 4 5 <div id="qv-wrapper"> 6 <div id="qv"> 7 <ol> 8 <li> 9 <a href="#supported-features"> Java 8 API</a> 10 </li> 11 <li> 12 <a href="#configuration"> Java 8 Jack </a> 13 </li> 14 </ol> 15 </div> 16 </div> 17 18 <p>Android N Java 8 Android N Android N Preview 19 20 21 22 23 </p> 24 25 <p> Android Studio 2.1 () Android N Preview SDK Jack Gradle Android Android N Preview SDK<a href="{@docRoot}preview/setup-sdk.html"> Android N </a> 26 27 28 </p> 29 30 31 32 <p class="note"> 33 <strong></strong> Java 8 Android N Java 8 Java 7 JDK 8 Android N 34 35 36 37 38 </p> 39 40 <h2 id="supported-features"> 41 Java 8 API 42 </h2> 43 44 <p> 45 Android Java 8 Android N Preview 46 47 48 </p> 49 50 <ul> 51 <li> 52 <a class="external-link" href="https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html"></a> 53 54 </li> 55 56 <li> 57 <a class="external-link" href="https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html">Lambda </a> 58 59 </li> 60 61 <li> 62 <a class="external-link" href="https://docs.oracle.com/javase/tutorial/java/annotations/repeating.html"></a> 63 64 </li> 65 </ul> 66 67 68 <p> 69 Java 8 API 70 </p> 71 72 <ul> 73 <li>Reflection API 74 </li> 75 76 <li style="list-style: none; display: inline"> 77 <ul> 78 <li>{@code java.lang.FunctionalInterface} 79 </li> 80 81 <li>{@code java.lang.annotation.Repeatable} 82 </li> 83 84 <li>{@code java.lang.reflect.Method.isDefault()} 85 </li> 86 87 <li> Reflection API () {@code AnnotatedElement.getAnnotationsByType(Class)} 88 89 </li> 90 </ul> 91 </li> 92 <li> API 93 </li> 94 95 <li style="list-style: none; display: inline"> 96 <ul> 97 <li>{@code java.util.function} 98 </li> 99 </ul> 100 </li> 101 </ul> 102 103 <p class="note"> 104 <strong></strong>Android N Lambda Android Lambda {@code 105 build.gradle} {@code compileSdkVersion} {@code 106 targetSdkVersion} 23 107 108 109 110 </p> 111 112 <h2 id="configuration"> 113 Java 8 Jack 114 </h2> 115 116 <p> 117 Java 8 <a class="external-link" href="https://source.android.com/source/jack.html">Jack </a> Android Java Android Dex {@code .jack} (Obfuscation ) Dex (Multidex) 118 119 120 121 122 123 </p> 124 125 <p> Android DEX </p> 126 <ul> 127 <li> javac <br> 128 <b>javac</b> ({@code .java} --> {@code .class}) --> <b>dx</b> ({@code 129 .class} --> {@code .dex}) 130 </li> 131 132 <li> Jack <br> 133 <b>Jack</b> ({@code .java} --> {@code .jack} --> {@code .dex}) 134 </li> 135 </ul> 136 137 <h3> 138 Gradle 139 </h3> 140 141 <p> 142 Java 8 Jack {@code build.gradle} 143 144 </p> 145 146 <pre> 147 android { 148 ... 149 defaultConfig { 150 ... 151 jackOptions { 152 enabled true 153 } 154 } 155 compileOptions { 156 sourceCompatibility JavaVersion.VERSION_1_8 157 targetCompatibility JavaVersion.VERSION_1_8 158 } 159 } 160 </pre> 161 162 <h3> 163 164 </h3> 165 166 <p> 167 ( Android Studio 2.0 (Beta) ) Jack 168 169 </p> 170 171 <p> Jack Jack 172 173 </p> 174 175 <ul> 176 <li> Lint 177 </li> 178 179 <li> ( JaCoCo Mockito) 180 </li> 181 </ul> 182 183 <p> Jack <a href="http://tools.android.com/filing-bugs"></a></p>