Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 1 | page.title=L Developer Preview APIs |
| 2 | excludeFromSuggestions=true |
| 3 | sdk.platform.apiLevel=20 |
| 4 | @jd:body |
| 5 | |
| 6 | |
| 7 | <div id="qv-wrapper"> |
| 8 | <div id="qv"> |
| 9 | |
| 10 | <h2>In this document |
| 11 | <a href="#" onclick="hideNestedItems('#toc44',this);return false;" class="header-toggle"> |
| 12 | <span class="more">show more</span> |
| 13 | <span class="less" style="display:none">show less</span></a></h2> |
| 14 | |
| 15 | <ol id="toc44" class="hide-nested"> |
| 16 | <li><a href="#Behaviors">Important Behavior Changes</a> |
| 17 | <ol> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 18 | <li><a href="#ART">New Android Runtime (ART)</a></li> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 19 | <li><a href="#BehaviorNotifications">If your app implements notifications...</a></li> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 20 | <li><a href="#BehaviorMediaControl">If your app uses RemoteControlClient...</a></li> |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 21 | <li><a href="#BehaviorGetRecentTasks">If your app uses ActivityManager.getRecentTasks()...</a></li> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 22 | </ol> |
| 23 | </li> |
| 24 | <li><a href="#UI">User Interface</a> |
| 25 | <ol> |
| 26 | <li><a href="#MaterialDesign">Material design support</a></li> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 27 | <li><a href="#DoNotDisturb">Do Not Disturb mode</a></li> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 28 | <li><a href="#LockscreenNotifications">Lockscreen notifications</a></li> |
| 29 | <li><a href="#NotificationsMetadata">Notifications metadata</a></li> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 30 | <li><a href="#Recents">Concurrent documents and activities in the Recents screen</a></li> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 31 | <li><a href="#WebView">WebView updates</a></li> |
| 32 | </ol> |
| 33 | </li> |
| 34 | <li><a href="#UserInput">User Input</a> |
| 35 | <ol> |
| 36 | <li><a href="#IME">IME bug fixes and improvements</a></li> |
| 37 | </ol> |
| 38 | </li> |
| 39 | <li><a href="#Animations">Animation & Graphics</a> |
| 40 | <ol> |
| 41 | <li><a href="#OpenGLES-3-1">Support for OpenGL ES 3.1</a></li> |
| 42 | </ol> |
| 43 | </li> |
| 44 | <li><a href="#Multimedia">Multimedia</a> |
| 45 | <ol> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 46 | <li><a href="#Camera-v2">Camera v2 API</a></li> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 47 | <li><a href="#AudioPlayback">Audio playback</a></li> |
| 48 | <li><a href="#MediaPlaybackControl">Media playback control</a></li> |
| 49 | </ol> |
| 50 | </li> |
| 51 | <li><a href="#Storage">Storage</a> |
| 52 | <ol> |
| 53 | <li><a href="#DirectorySelection">Directory selection</a></li> |
| 54 | </ol> |
| 55 | </li> |
| 56 | <li><a href="#Wireless">Wireless and Connectivity</a> |
| 57 | <ol> |
| 58 | <li><a href="#Multinetwork">Dynamic network selection and seamless handoff</a></li> |
| 59 | <li><a href="#BluetoothBroadcasting">Bluetooth broadcasting</a></li> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 60 | <li><a href="#NFCEnhancements">NFC enhancements</a></li> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 61 | </ol> |
| 62 | </li> |
| 63 | <li><a href="#Power">Power Efficiency</a> |
| 64 | <ol> |
| 65 | <li><a href="#JobScheduler">Scheduling Jobs</a></li> |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 66 | <li><a href="#PowerMeasurementTools">Developer tools for power measurement</a> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 67 | </ol> |
| 68 | </li> |
| 69 | <li><a href="#Enterprise">Enterprise</a> |
| 70 | <ol> |
| 71 | <li><a href="#ManagedProvisioning">Managed provisioning</a></li> |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 72 | <li><a href="#TaskLocking">Task locking</a></li> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 73 | </ol> |
| 74 | </li> |
| 75 | <li><a href="#Printing">Printing Framework</a> |
| 76 | <ol> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 77 | <li><a href="#PDFRender">Render PDF as bitmap</a></li> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 78 | </ol> |
| 79 | </li> |
| 80 | <li><a href="#TestingA11y">Testing & Accessibility</a> |
| 81 | <ol> |
| 82 | <li><a href="#TestingA11yImprovements">Testing and accessibility improvements</a></li> |
| 83 | </ol> |
| 84 | </li> |
| 85 | <li><a href="#Manifest">Manifest Declarations</a> |
| 86 | <ol> |
| 87 | <li><a href="#ManifestFeatures">Declarable required features</a></li> |
| 88 | <li><a href="#ManifestPermissions">User permissions</a></li> |
| 89 | </ol> |
| 90 | </li> |
| 91 | </ol> |
| 92 | |
| 93 | <h2>See also</h2> |
| 94 | <ol> |
| 95 | <li><a href="{@docRoot}sdk/api_diff/20/changes.html">API |
| 96 | Differences Report »</a> </li> |
| 97 | </ol> |
| 98 | |
| 99 | </div> |
| 100 | </div> |
| 101 | |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 102 | <p>The L Developer Preview gives you an advance look at the upcoming release |
| 103 | for the Android platform, which offers new features for users and app |
| 104 | developers. This document provides an introduction to the most notable APIs.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 105 | |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 106 | <p>The L Developer Preview is intended for <strong>developer early |
| 107 | adopters</strong> and <strong>testers</strong>. If you are interested in |
| 108 | influencing the direction of the Android framework, |
| 109 | <a href="{@docRoot}preview/setup-sdk.html">give the L Developer Preview a |
| 110 | try</a> and send us your feedback!</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 111 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 112 | <p class="caution"><strong>Caution:</strong> Do not not publish apps |
| 113 | that use the L Developer Preview to the Google Play store.</p> |
| 114 | |
| 115 | <p class="note"><strong>Note:</strong> This document often refers to classes and |
| 116 | methods that do not yet have reference material available on <a |
| 117 | href="{@docRoot}">developer.android.com</a>. These API elements are |
| 118 | formatted in {@code code style} in this document (without hyperlinks). For the |
| 119 | preliminary API documentation for these elements, download the <a |
| 120 | href="{@docRoot}preview/l-developer-preview-reference.zip">preview |
| 121 | reference</a>.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 122 | |
| 123 | <h2 id="Behaviors">Important Behavior Changes</h2> |
| 124 | |
| 125 | <p>If you have previously published an app for Android, be aware that your app |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 126 | might be affected by changes in the upcoming release.</p> |
| 127 | |
| 128 | <h3 id="ART">New Android Runtime (ART)</h3> |
| 129 | |
| 130 | <p>The 4.4 release introduced a new, experimental Android runtime, ART. Under |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 131 | 4.4, ART was optional, and the default runtime remained Dalvik. With the L |
| 132 | Developer Preview, ART is now the default runtime.</p> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 133 | |
| 134 | <p>For an overview of ART's new features, see |
| 135 | <a href="https://source.android.com/devices/tech/dalvik/art.html">Introducing |
| 136 | ART</a>. Some of the major new features are:</p> |
| 137 | |
| 138 | <ul> |
| 139 | <li>Ahead-of-Time (AOT) compilation</li> |
| 140 | <li>Improved garbage collection (GC)</li> |
| 141 | <li>Improved debugging support</li> |
| 142 | </ul> |
| 143 | |
| 144 | <p>Most Android apps should just work without change under ART. However, some |
| 145 | techniques that work on Dalvik do not work on ART. For information about the |
| 146 | most important issues, see |
| 147 | <a href="{@docRoot}guide/practices/verifying-apps-art.html">Verifying App |
| 148 | Behavior on the Android Runtime (ART)</a>. Pay particular attention if:</p> |
| 149 | |
| 150 | <ul> |
| 151 | <li>Your app uses Java Native Interface (JNI) to run C/C++ code.</li> |
| 152 | <li>You use development tools that generate non-standard code (such as some |
| 153 | obfuscators).</li> |
| 154 | <li>You use techniques that are incompatible with compacting garbage |
| 155 | collection. (ART does not currently implement compacting GC, but |
| 156 | compacting GC is under development in the Android Open-Source |
| 157 | Project.)</li> |
| 158 | </ul> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 159 | |
| 160 | <h3 id="BehaviorNotifications">If your app implements notifications...</h3> |
| 161 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 162 | <p>Notifications are drawn with dark text atop white (or very light) |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 163 | backgrounds to match the new material design widgets. Make sure that all your |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 164 | notifications look right with the new color scheme:</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 165 | |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 166 | <div class="figure" style="width:320px"> |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 167 | <img src="images/hun-example.png" |
| 168 | srcset="images/hun-example@2x.png 2x" |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 169 | alt="" width="320" height="541" id="figure1" /> |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 170 | <p class="img-caption"> |
| 171 | <strong>Figure 1.</strong> Fullscreen activity showing a heads-up notification |
| 172 | </p> |
| 173 | </div> |
| 174 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 175 | <ul> |
| 176 | |
| 177 | <li>Update or remove assets that involve color.</li> |
| 178 | |
| 179 | <li>The system automatically inverts action icons in notifications. Use |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 180 | {@code android.app.Notification. Builder.setColor()} to set an accent color |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 181 | in a circle behind your {@link android.app.Notification#icon} image.</li> |
| 182 | |
| 183 | <li>The system ignores all non-alpha channels in action icons and the main |
| 184 | notification icon. You should assume that these icons are alpha-only.</li> |
| 185 | |
| 186 | </ul> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 187 | |
| 188 | <p>If you are currently adding sounds and vibrations to your notifications by |
| 189 | using the {@link android.media.Ringtone}, {@link android.media.MediaPlayer}, |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 190 | or {@link android.os.Vibrator} classes, remove this code so that |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 191 | the system can present notifications correctly in <a href="#DoNotDisturb">Do |
| 192 | Not Disturb</a> mode. Instead, use the {@link android.app.Notification.Builder} |
| 193 | methods instead to add sounds and vibration.</p> |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 194 | |
| 195 | <p>Notifications now appear in a small floating window |
| 196 | (also called a <em>heads-up notification</em>) when the device is active |
| 197 | (that is, the device is unlocked and its screen is on). These notifications |
| 198 | appear similar to the compact form of your notification, except that the |
| 199 | heads-up notification also shows action buttons. Users can act on, or dismiss, |
| 200 | a heads-up notification without leaving the current app.</p> |
| 201 | |
| 202 | <p>Examples of conditions that may trigger heads-up notifications include:</p> |
| 203 | |
| 204 | <ul> |
| 205 | <li>The user's activity is in fullscreen mode (the app uses |
| 206 | {@link android.app.Notification#fullScreenIntent}), or</li> |
| 207 | <li>The notification has high priority and uses ringtones or |
| 208 | vibrations</li> |
| 209 | </ul> |
| 210 | |
| 211 | <p>If your app implements notifications under those scenarios, make sure that |
| 212 | heads-up notifications are presented correctly.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 213 | |
| 214 | <h3 id="BehaviorMediaControl">If your app uses RemoteControlClient...</h3> |
| 215 | |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 216 | <p>Lockscreens in the L Developer Preview do not show transport controls for |
| 217 | your {@link android.media.RemoteControlClient}. Instead, your app can provide |
| 218 | media playback control from the lockscreen through a notification. This |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 219 | gives your app more control over the presentation of media buttons, while |
| 220 | providing a consistent experience for users across the lockscreen and |
Quddus Chong | d50a6f8 | 2014-06-15 12:13:18 -0700 | [diff] [blame] | 221 | unlocked device.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 222 | |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 223 | <p>The L Developer Preview introduces a new |
| 224 | {@code android.app.Notification.MediaStyle} template which is recommended for |
| 225 | this purpose. {@code MediaStyle} converts notification actions that you added |
| 226 | with |
| 227 | {@link android.app.Notification.Builder#addAction(int, java.lang.CharSequence, |
| 228 | android.app.PendingIntent) |
| 229 | Notification.Builder.addAction()} into compact buttons embedded in your app's |
| 230 | media playback notifications.</p> |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 231 | |
| 232 | <p>If you are using the new |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 233 | {@code android.media.session.MediaSession} class |
| 234 | (see <a href="#MediaPlaybackControl">Media Playback Control</a> below), attach |
| 235 | your session token with {@code Notification.MediaStyle.setMediaToken()} to |
| 236 | inform the system that this notification controls an ongoing media session.</p> |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 237 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 238 | <p>Call {@code |
| 239 | Notification.Builder.setVisibility(Notification.VISIBILITY_PUBLIC)} to mark a |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 240 | notification as safe to show atop any lockscreen (secure or otherwise). For more |
| 241 | information, see <a href="#LockscreenNotifications">Lockscreen Notifications</a>.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 242 | |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 243 | <h3 id="BehaviorGetRecentTasks">If your app uses ActivityManager.getRecentTasks()...</h3> |
| 244 | |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 245 | <p>With the introduction of the new <em>concurrent documents and activities |
| 246 | tasks</em> feature in the upcoming release (see <a href="#Recents">Concurrent |
| 247 | documents and activities in Recents screen</a> below), |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 248 | the {@link android.app.ActivityManager#getRecentTasks |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 249 | ActivityManager.getRecentTasks()} method is now deprecated to improve user |
| 250 | privacy. For backward compatibility, this method still returns a small subset of |
| 251 | its data, including the calling application’s own tasks and possibly some other |
| 252 | non-sensitive tasks (such as Home). If your app is using this method to retrieve |
| 253 | its own tasks, use {@code android.app.ActivityManager.getAppTasks()} instead to |
| 254 | retrieve that information.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 255 | |
| 256 | <h2 id="UI">User Interface</h2> |
| 257 | |
| 258 | <h3 id="MaterialDesign">Material design support</h3> |
| 259 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 260 | <p>The upcoming release adds support for Android's new <em>material</em> design |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 261 | style. You can create apps with material design that are visually dynamic and |
| 262 | have UI element transitions that feel natural to users. This support includes:</p> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 263 | |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 264 | <ul> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 265 | |
| 266 | <li>The material theme</li> |
Ricardo Cervera | d3e426b | 2014-06-15 16:01:28 -0700 | [diff] [blame] | 267 | <li>View shadows</li> |
| 268 | <li>The {@code RecyclerView} widget</li> |
| 269 | <li>Drawable animation and styling effects</li> |
| 270 | <li>Material design animation and activity transition effects</li> |
| 271 | <li>Animators for view properties based on the state of a view</li> |
| 272 | <li>Customizable UI widgets and app bars with color palettes that you control</li> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 273 | </ul> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 274 | |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 275 | <p>To learn more about adding material design functionality to your app, see |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 276 | <a href="{@docRoot}preview/material/index.html">Material Design</a>.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 277 | |
| 278 | <h3 id="LockscreenNotifications">Lockscreen notifications</h3> |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 279 | <p>Lockscreens in the L Developer Preview have the ability to present |
| 280 | notifications. Users can choose via <em>Settings</em> whether to allow |
| 281 | sensitive notification content to be shown over a secure lockscreen.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 282 | |
| 283 | <p>Your app can control the level of detail visible when its notifications are |
Ricardo Cervera | d3e426b | 2014-06-15 16:01:28 -0700 | [diff] [blame] | 284 | displayed over the secure lockscreen. To control the visibility level, call |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 285 | {@code android.app.Notification.Builder.setVisibility()} and specify one of these |
| 286 | values:</p> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 287 | |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 288 | <ul> |
| 289 | <li>{@code VISIBILITY_PRIVATE}. Shows basic information, such as the |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 290 | notification’s icon, but hides the notification’s full content.</li> |
| 291 | <li>{@code VISIBILITY_PUBLIC}. Shows the notification’s full content.</li> |
| 292 | <li>{@code VISIBILITY_SECRET}. Shows nothing, excluding even the |
| 293 | notification’s icon.</li> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 294 | </ul> |
| 295 | |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 296 | <p>When {@code VISIBILITY_PRIVATE} is set, you can also provide a redacted |
| 297 | version of the notification content that hides personal details. For example, |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 298 | an SMS app might display a notification that shows "You have 3 new text messages." |
| 299 | but hides the message content and senders. To provide this alternative |
| 300 | notification, first create the replacement notification using |
| 301 | {@link android.app.Notification.Builder}. When you create the private |
| 302 | notification object, attach the replacement notification to it through the |
| 303 | {@code Notification.Builder.setPublicVersion()} method.</p> |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 304 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 305 | <h3 id="DoNotDisturb">Do Not Disturb mode</h3> |
| 306 | |
| 307 | <p>The L Developer Preview introduces a new <em>Do Not Disturb</em> mode. When |
| 308 | the user puts the device in <em>Do Not Disturb</em> mode, the device limits |
| 309 | the frequency of the notifications it shows the user (when the user |
| 310 | wants to avoid distractions). The user can |
| 311 | customize the feature in a number of ways, such as:</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 312 | |
| 313 | <ul> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 314 | <li>Specifying important people, whose calls should go through even when |
| 315 | the device is in <em>Do Not Disturb</em> mode.</li> |
| 316 | <li>Setting custom categories to allow notifications when the device is in |
| 317 | <em>Do Not Disturb</em> mode. Examples of such categories include phone |
| 318 | calls and direct communications (like Hangouts and Skype calls).</li> |
| 319 | <li>Setting rules so <em>Do Not Disturb</em> automatically goes into effect in |
| 320 | certain conditions (like at particular times of day).</li> |
| 321 | </ul> |
| 322 | |
| 323 | <p>You should add the appropriate metadata to your app notifications to help |
| 324 | make sure <em>Do Not Disturb</em> mode handles them properly. For example, if |
| 325 | your app is an alarm clock, |
| 326 | you can tag the notification as an alarm so it will wake the user up even if the |
| 327 | device is in <em>Do Not Disturb</em> mode. For more information, see <a |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 328 | href="#NotificationsMetadata">Notifications metadata</a>.</p> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 329 | |
| 330 | <h3 id="NotificationsMetadata">Notifications metadata</h3> |
| 331 | <p>The L Developer Preview uses metadata associated with your app notifications |
| 332 | to sort the notifications more intelligently. The metadata you set also |
| 333 | controls how the system presents your app notifications when the user is in <em>Do |
| 334 | Not Disturb</em> mode. To set the metadata, call the following methods in |
| 335 | {@code android.app.Notification.Builder} when you construct the |
| 336 | notification:</p> |
| 337 | |
| 338 | <ul> |
| 339 | <li>{@code setCategory()}. Depending on the message category, this tells |
| 340 | the system how to handle your app notifications when the device is |
| 341 | in <em>Do Not Disturb</em> mode (for example, if your notification represents an |
| 342 | incoming call, instant message, or alarm). |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 343 | <li>{@code setPriority()}. Notifications with the priority field set to |
| 344 | {@code PRIORITY_MAX} or {@code PRIORITY_HIGH} will appear in a small floating |
Ricardo Cervera | d3e426b | 2014-06-15 16:01:28 -0700 | [diff] [blame] | 345 | window if the notification also has sound or vibration.</li> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 346 | <li>{@code addPerson()}. Allows you to add a list of people to a notification. |
| 347 | Your app can use this to signal to the system that it should group together |
| 348 | notifications from the specified people, or rank notifications from these |
Ricardo Cervera | d3e426b | 2014-06-15 16:01:28 -0700 | [diff] [blame] | 349 | people as being more important.</li> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 350 | </ul> |
| 351 | |
Ricardo Cervera | d3e426b | 2014-06-15 16:01:28 -0700 | [diff] [blame] | 352 | <h3 id="Recents">Concurrent documents and activities in the Recents screen</h3> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 353 | |
| 354 | <p>In previous releases, the |
| 355 | <a href="{@docRoot}design/get-started/ui-overview.html">Recents screen</a> |
| 356 | could only display a single task for each app that the user interacted with |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 357 | most recently. The L Developer Preview enables your app to open more tasks as |
| 358 | needed for additional concurrent activities for documents. |
| 359 | This feature facilitates multitasking |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 360 | by letting users quickly switch between individual activities and documents |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 361 | from the Recents screen, with a consistent switching experience across all apps. |
| 362 | Examples of such concurrent tasks might include open tabs in a web |
| 363 | browser app, documents in a productivity app, concurrent matches in |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 364 | a game, or chats in a messaging app. Your app can manage its tasks |
| 365 | through the {@code android.app.ActivityManager.AppTask} class.</p> |
| 366 | |
| 367 | <p>To insert a logical break so that the system treats your activity as a new |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 368 | task, use {@code android.content.Intent.FLAG_ACTIVITY_NEW_DOCUMENT} when |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 369 | launching the activity with {@link android.app.Activity#startActivity(android.content.Intent) |
| 370 | startActivity()}. You can also get this behavior by declaring the |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 371 | <a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a> |
| 372 | attribute {@code documentLaunchMode="intoExisting"} or {@code ="always"} in your |
| 373 | manifest.</p> |
| 374 | |
| 375 | <p>You can also mark that a task should be removed from the Recents screen |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 376 | when all its activities are closed. To do this, use {@code |
| 377 | android.content.Intent.FLAG_ACTIVITY_AUTO_REMOVE_FROM_RECENTS} when starting the |
| 378 | root activity for |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 379 | the task. You can also set this behavior for an activity by declaring the |
| 380 | <a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a> |
| 381 | attribute {@code autoRemoveFromRecents=“true”} in your manifest.</p> |
| 382 | |
| 383 | <p>To avoid cluttering the Recents screen, you can set the maximum number of |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 384 | tasks from your app that can appear in that screen. To do this, set the |
| 385 | <a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a> |
| 386 | attribute {@code android:maxRecent}. The current maximum that can be specified |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 387 | is 100 tasks per user.</a></p> |
| 388 | |
| 389 | <h3 id="WebView">WebView updates</h3> |
| 390 | <p>The L Developer Preview updates the {@link android.webkit.WebView} |
| 391 | implementation to Chromium M36, bringing security and stability enhancements, |
| 392 | as well as bug fixes. The default user-agent string for a |
| 393 | {@link android.webkit.WebView} running on the L Developer Preview has |
| 394 | been updated to incorporate 36.0.0.0 as the version number.</p> |
| 395 | |
| 396 | <p>Additionally, this release brings support for the |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 397 | <a href="https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html">WebAudio</a>, |
| 398 | <a href="https://www.khronos.org/webgl/">WebGL</a>, and |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 399 | <a href="http://www.webrtc.org/">WebRTC</a> open standards. To learn more about |
| 400 | the new features included in this release, see <a href="https://developer.chrome.com/multidevice/webview/overview">WebView for Android</a>.</p> |
| 401 | |
| 402 | <h2 id="UserInput">User Input</h2> |
| 403 | |
| 404 | <h3 id="IME">IME bug fixes and improvements</h3> |
| 405 | |
| 406 | <p>Beginning in the L Developer Preview, users can more easily switch between |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 407 | all <a href="{@docRoot}guide/topics/text/creating-input-method.html">input |
| 408 | method editors (IME)</a> supported by the platform. Performing the designated |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 409 | switching action (usually touching a Globe icon on the soft keyboard) will cycle |
| 410 | among all such IMEs. This change takes place in |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 411 | {@link android.view.inputmethod.InputMethodManager#shouldOfferSwitchingToNextInputMethod |
| 412 | InputMethodManager.shouldOfferSwitchingToNextInputMethod()}.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 413 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 414 | <p>In addition, the framework now checks whether the next IME includes a |
| 415 | switching mechanism at all (and, thus, whether that IME supports switching to |
| 416 | the IME after it). An |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 417 | IME with a switching mechanism will not cycle to an IME without one. This |
| 418 | change takes place in |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 419 | {@link android.view.inputmethod.InputMethodManager#switchToNextInputMethod |
| 420 | InputMethodManager.switchToNextInputMethod}. |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 421 | |
| 422 | <p>To see an example of how to use the updated IME-switching APIs, refer to the |
| 423 | updated soft-keyboard implementation sample in this release.</p> |
| 424 | |
| 425 | <h2 id="Animations">Animation & Graphics</h2> |
| 426 | |
| 427 | <h3 id="OpenGLES-3-1">Support for OpenGL ES 3.1</h3> |
| 428 | <p>The L Developer Preview adds Java interfaces and native support for OpenGL |
| 429 | ES 3.1. Key new functionality provided in OpenGL ES 3.1 includes:</p> |
| 430 | |
| 431 | <ul> |
| 432 | <li>Compute shaders |
| 433 | <li>Separate shader objects |
| 434 | <li>Indirect draw commands |
| 435 | <li>Enhanced texturing functionality |
| 436 | <li>Shading language improvements |
| 437 | <li>Optional extensions for per-sample shading, advanced blending modes, and more |
| 438 | <li>Backward compatibility with OpenGL ES 2.0 and 3.0 |
| 439 | </ul> |
| 440 | |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 441 | <p>The Java interface for OpenGL ES 3.1 on Android is provided with GLES31. When |
| 442 | using OpenGL ES 3.1, be sure that you declare it in your manifest file with the |
| 443 | <a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a> |
| 444 | tag and the {@code android:glEsVversion} attribute. For example:</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 445 | |
| 446 | <pre> |
| 447 | <manifest> |
| 448 | <uses-feature android:glEsVersion="0x00030001" /> |
| 449 | ... |
| 450 | </manifest> |
| 451 | </pre> |
| 452 | |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 453 | <p>For more information about using OpenGL ES, including how to check the |
| 454 | device’s supported OpenGL ES version at runtime, see the |
| 455 | <a href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL ES API guide</a>.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 456 | |
| 457 | <h2 id="Multimedia">Multimedia</h2> |
| 458 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 459 | <h3 id="Camera-v2">Camera v2 API</h3> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 460 | |
| 461 | <p>The L Developer Preview introduces the new {@code android.hardware.camera2} |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 462 | API to facilitate fine-grain photo capture and image processing. You can now |
| 463 | programmatically access the camera devices available to the system with {@code |
| 464 | CameraManager.getCameraIdList()} and connect to a specific device with {@code |
| 465 | CameraManager.openCamera()}. To start capturing images, create a {@code |
| 466 | CameraCaptureSession} and specify the {@link android.view.Surface} objects for |
| 467 | the captured images. The {@code CameraCaptureSession} can be configured to take |
| 468 | single shots or multiple images in a burst.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 469 | |
| 470 | <p>To be notified when new images are captured, implement the |
| 471 | {@code CameraCaptureSession.CaptureListener()} interface and set it in your |
| 472 | capture request. Now when the system completes the image capture request, your |
| 473 | {@code CameraCaptureSession.CaptureListener()} receives a call to |
| 474 | {@code onCaptureCompleted()}, providing you with the image capture metadata in a |
| 475 | {@code CaptureResult}.</p> |
| 476 | |
| 477 | <h3 id="AudioPlayback">Audio playback</h3> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 478 | <p>This release includes the following changes to |
| 479 | {@link android.media.AudioTrack}:</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 480 | <ul> |
| 481 | <li>Your app can now supply audio data in floating-point format |
| 482 | ({@code android.media.AudioFormat.ENCODING_PCM_FLOAT}). This permits greater |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 483 | dynamic range, more consistent precision, and greater headroom. Floating-point |
| 484 | arithmetic is especially useful during intermediate calculations. Playback |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 485 | end-points use integer format for audio data, and with lower bit-depth. (In the |
| 486 | L Developer Preview, portions of the internal pipeline are not yet |
| 487 | floating-point.) |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 488 | <li>Your app can now supply audio data as a {@link java.nio.ByteBuffer}, in |
| 489 | the same format as provided by {@link android.media.MediaCodec}. |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 490 | <li>The {@code WRITE_NON_BLOCKING} option can simplify buffering and |
| 491 | multithreading for some apps. |
| 492 | </ul> |
| 493 | |
| 494 | <h3 id="MediaPlaybackControl">Media playback control</h3> |
| 495 | <p>You can now build your own media controller app with the new |
| 496 | {@code android.media.session.MediaController} class, which provides |
| 497 | simplified transport controls APIs that replace those in |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 498 | {@link android.media.RemoteControlClient}. The {@code MediaController} class |
| 499 | allows thread-safe control of playback from a non-UI process, making it easier |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 500 | to control your media playback service from your app’s user interface. |
| 501 | |
| 502 | <p>You can also create multiple controllers to send playback commands, |
| 503 | media keys, and other events to the same ongoing |
| 504 | {@code android.media.session.MediaSession}. When you add a controller, you must |
| 505 | call {@code MediaSession.getSessionToken()} to request an access |
| 506 | token in order for your app to interact with the session.</p> |
| 507 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 508 | <p>You can now send transport commands such as "play", "stop", "skip", and |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 509 | "set rating" by using {@code MediaController.TransportControls}. To handle |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 510 | in-bound media transport commands from controllers attached to the session, |
| 511 | override the callback methods in |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 512 | {@code MediaSession.TransportControlsCallback}.</p> |
| 513 | |
| 514 | <p>You can also create rich notifications that allow playback control tied to a |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 515 | media session with the new {@code android.app.Notification.MediaStyle} class. By |
| 516 | using the new notification and media APIs, you will ensure that the System UI |
| 517 | knows about your playback and can extract and show album art.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 518 | |
| 519 | <h2 id="Storage">Storage</h2> |
| 520 | |
| 521 | <h3 id="DirectorySelection">Directory selection</h3> |
| 522 | |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 523 | <p>The L Developer Preview extends the <a href="{@docRoot}guide/topics/providers/document-provider.html">Storage Access Framework</a> to let users select an entire directory subtree, |
| 524 | giving apps read/write access to all contained documents without requiring user |
| 525 | confirmation for each item.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 526 | |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 527 | <p>To select a directory subtree, build and send an |
| 528 | {@code android.intent.action.OPEN_DOCUMENT_TREE} {@link android.content.Intent}. |
| 529 | The system displays all |
| 530 | {@link android.provider.DocumentsProvider} instances that support subtree selection, |
| 531 | letting the user browse and select a directory. The returned URI represents access to the selected |
| 532 | subtree. You can then use {@code DocumentsContract.buildChildDocumentsUriUsingTree()} |
| 533 | and {@code DocumentsContract.buildDocumentUriUsingTree()} along with |
| 534 | {@code ContentResolver.query()} to explore the subtree.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 535 | |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 536 | <p>The new {@code DocumentsContract.createDocument()} method lets you create |
| 537 | new documents or directories anywhere under the subtree. To manage |
| 538 | existing documents, use {@code DocumentsContract.renameDocument()} and |
| 539 | {@code DocumentsContract.deleteDocument()}. Check {@code DocumentsContract.Document.COLUMN_FLAGS} |
| 540 | to verify provider support for these calls before issuing them.</p> |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 541 | |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 542 | <p>If you're implementing a {@link android.provider.DocumentsProvider} and want |
| 543 | to support subtree selection, implement {@code DocumentsProvider.isChildDocument()} |
| 544 | and include {@code Documents.Contract.FLAG_SUPPORTS_IS_CHILD} in your |
| 545 | {@code Root.COLUMN_FLAGS}.</p> |
| 546 | |
| 547 | <p>The L Developer Preview also introduces new package-specific directories on |
| 548 | shared storage where your app can place media files for inclusion in |
| 549 | {@link android.provider.MediaStore}. The new |
| 550 | {@code android.content.Context.getExternalMediaDirs()} returns paths to these |
| 551 | directories on all shared storage devices. Similarly to |
| 552 | {@link android.content.Context#getExternalFilesDir(java.lang.String) Context.getExternalFilesDir()}, |
| 553 | no additional permissions are needed by your app to access the returned paths. The |
| 554 | platform periodically scans for new media in these directories, but you can also |
| 555 | use {@link android.media.MediaScannerConnection} to explicitly scan for new |
| 556 | content.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 557 | |
| 558 | <h2 id="Wireless">Wireless & Connectivity</h2> |
| 559 | |
| 560 | <h3 id="Multinetwork">Dynamic network selection and seamless handoff</h3> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 561 | <p>The L Developer Preview provides new multi-networking APIs. These let your app |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 562 | dynamically scan for available networks with specific capabilities, and |
| 563 | establish a connection to them. This is useful when your app requires a |
| 564 | specialized network, such as an SUPL, MMS, or carrier-billing network, or if |
| 565 | you want to send data using a particular type of transport protocol.</p> |
| 566 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 567 | <p>To select and connect to a network dynamically from your app follow these |
| 568 | steps:</p> |
| 569 | |
| 570 | <ol> |
| 571 | <li>Create a {@link android.net.ConnectivityManager}.</li> |
| 572 | <li>Create a |
| 573 | {@code android.net.NetworkRequest} to specify the network features and transport |
| 574 | type your app is interested in.</li> |
| 575 | <li>To scan for suitable networks, call |
| 576 | {@code ConnectivityManager.requestNetwork()} or |
| 577 | {@code ConnectivityManager.registerNetworkCallback()}, and pass in the |
| 578 | {@code NetworkRequest} object and an implementation of |
| 579 | {@code ConnectivityManager.NetworkCallbackListener}.</li> |
| 580 | |
| 581 | </ol> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 582 | |
| 583 | <p>When the system detects a suitable network, it connects to the network and |
| 584 | invokes the {@code NetworkCallbackListener.onAvailable()} callback. You can use |
| 585 | the {@code android.net.Network} object from the callback to get additional |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 586 | information about the network, or to direct traffic to use the selected |
| 587 | network.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 588 | |
| 589 | <h3 id="BluetoothBroadcasting">Bluetooth broadcasting</h3> |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 590 | <p>Android 4.3 introduced platform support for |
| 591 | <a href="{@docRoot}guide/topics/connectivity/bluetooth-le.html">Bluetooth Low Energy</a> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 592 | (BLE) in the central role. In the L Developer Preview, an Android device can now |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 593 | act as a Bluetooth LE <em>peripheral device</em>. Apps can use this capability |
| 594 | to make their presence known to |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 595 | nearby devices. For instance, you can build apps that allow a device to |
| 596 | function as a pedometer or health monitor and communicate its data with another |
| 597 | BLE device.</p> |
| 598 | |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 599 | <p>The new {@code android.bluetooth.le} APIs enable your apps to broadcast |
| 600 | advertisements, scan for responses, and form connections with nearby BLE devices. |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 601 | You must add the {@code android.permission.BLUETOOTH_ADMIN} permission in your |
| 602 | manifest in order for your app to use the new advertising and scanning features.</a> |
| 603 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 604 | <p>To begin Bluetooth LE advertising so that other devices can discover |
| 605 | your app, call {@code android.bluetooth.le.BluetoothAdvertiser.startAdvisertising()} |
| 606 | and pass in an implementation of the |
| 607 | {@code android.bluetooth.le.AdvertiseCallback} class. The callback object |
| 608 | receives a report of the success or failure of the advertising operation.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 609 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 610 | <p> The L Developer Preview introduces the {@code |
| 611 | android.bluetooth.le.ScanFilter} class so that your app can scan for only the |
| 612 | specific types of devices it is interested in. To begin scanning for Bluetooth |
| 613 | LE devices, call {@code android.bluetooth.le.BluetoothLeScanner.startScan()} and |
| 614 | pass in a list of filters. In the method call, you must also provide an |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 615 | implementation of {@code android.bluetooth.le.ScanCallback} to report if a |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 616 | Bluetooth LE advertisement is found. </p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 617 | |
| 618 | <h3 id="NFCEnhancements">NFC enhancements</h3> |
| 619 | <p>The L Developer Preview adds these enhancements to enable wider and more |
| 620 | flexible use of NFC:</p> |
| 621 | |
| 622 | <ul> |
| 623 | <li>Android Beam is now available in the share menu. |
| 624 | <li>Your app can invoke the Android Beam on the user’s device to share data by |
| 625 | calling {@code android.nfc.NfcAdapter.invokeBeam()}. This avoids the need for |
| 626 | the user to manually tap the device against another NFC-capable device to |
| 627 | complete the data transfer. |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 628 | <li>You can use the new {@code android.nfc.NdefRecord.createTextRecord()} method |
| 629 | to create an NDEF record containing UTF-8 text data. |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 630 | <li>If you are developing a payment app, you now have the ability to |
| 631 | register an NFC application ID (AID) dynamically by calling |
| 632 | {@code android.nfc.cardemulation.CardEmulation.registerAidsForService()}. |
| 633 | You can also use {@code android.nfc.cardemulation.CardEmulation.setPreferredService()} |
| 634 | to set the preferred card emulation service that should be used when a specific |
| 635 | activity is in the foreground. |
| 636 | </ul> |
| 637 | |
| 638 | <h2 id="Power">Power Efficiency</h2> |
| 639 | |
| 640 | <h3 id="JobScheduler">Scheduling jobs</h3> |
| 641 | <p>The L Developer Preview provides a new {@code android.app.job.JobScheduler} |
Quddus Chong | d50a6f8 | 2014-06-15 12:13:18 -0700 | [diff] [blame] | 642 | API that lets you optimize battery life by defining jobs for the system to run |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 643 | asynchronously at a later time or under specified conditions (such as when the |
| 644 | device is charging). This is useful in such situations as:</p> |
| 645 | <ul> |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 646 | <li>The app has non-user-facing work that you can defer.</li> |
| 647 | <li>The app has work you'd prefer to do when the unit is plugged in.</li> |
| 648 | <li>The app has a task that requires network access (or requires a Wi-Fi |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 649 | connection).</li> |
| 650 | <li>The app has a number of tasks that you want to run as a batch on a regular |
| 651 | schedule.</li> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 652 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 653 | </ul> |
| 654 | |
| 655 | <p>A unit of work is encapsulated by a {@code android.app.job.JobInfo} object. |
| 656 | This object provides an exact description of the criteria to be used for |
| 657 | scheduling.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 658 | |
| 659 | <p>Use the {@code android.app.job.JobInfo.Builder} to configure how the |
| 660 | scheduled task should run. You can schedule the task to run under specific |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 661 | conditions, such as:</p> |
| 662 | |
| 663 | <ul> |
| 664 | <li>The device is charging</li> |
| 665 | <li>The device is connected to an unmetered network</li> |
| 666 | <li>The system deems the device to be idle</li> |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 667 | <li>Completion with a minimum delay or within a specific deadline.</li> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 668 | </ul> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 669 | |
| 670 | <p>For example, you can add code like this to run your task on an |
| 671 | unmetered network:</p> |
| 672 | |
| 673 | <pre> |
| 674 | JobInfo uploadTask = new JobInfo.Builder(mJobId, mServiceComponent) |
| 675 | .setRequiredNetworkCapabilities(JobInfo.NetworkType.UNMETERED) |
| 676 | .build(); |
| 677 | |
| 678 | JobScheduler jobScheduler = |
| 679 | (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE) |
| 680 | jobScheduler.schedule(uploadTask); |
| 681 | </pre> |
| 682 | |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 683 | <h3 id="PowerMeasurementTools">Developer tools for power measurement</h3> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 684 | <p>The L Developer Preview provides several new developer tools and APIs to help |
| 685 | you better measure and understand your app's power usage.</p> |
| 686 | |
| 687 | <dl> |
| 688 | <dt><strong>batterystats</strong></dt> |
| 689 | <dd> |
| 690 | <p>The {@code dumpsys batterystats} command allows you to generate interesting |
| 691 | statistical data about battery usage on a device, organized by unique user ID |
| 692 | (UID). The statistics generated by the tool include:</p> |
| 693 | |
| 694 | <ul> |
| 695 | <li>History of battery related events |
| 696 | <li>Global statistics for the device |
| 697 | <li>Approximated power use per UID and system component |
| 698 | <li>Per-app mobile ms per packet |
| 699 | <li>System UID aggregated statistics |
| 700 | <li>App UID aggregated statistics |
| 701 | </ul> |
| 702 | |
Quddus Chong | d50a6f8 | 2014-06-15 12:13:18 -0700 | [diff] [blame] | 703 | <p>Use the {@code --help} option to learn about the various options for |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 704 | tailoring the output. For example, to print battery usage |
| 705 | statistics for a given app package since the device was last charged, run this |
Quddus Chong | d50a6f8 | 2014-06-15 12:13:18 -0700 | [diff] [blame] | 706 | command: |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 707 | <pre> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 708 | $ adb shell dumpsys batterystats --charged <package-name> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 709 | </pre> |
| 710 | </dd> |
| 711 | |
| 712 | <dt><strong>Battery Historian</strong></dt> |
| 713 | <dd> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 714 | <p>The Battery Historian tool ({@code historian.par}) analyzes Android |
| 715 | bug reports from the L Developer Preview and creates an HTML visualization of |
| 716 | power-related events. It can |
| 717 | also visualize power consumption data from a power monitor, and attempts to |
| 718 | map power usage to the wake locks seen. You can find the Battery Historian tool |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 719 | in {@code <sdk>/tools}.</p> |
| 720 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 721 | <img src="images/battery_historian.png" |
| 722 | srcset="images/battery_historian@2x.png 2x" |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 723 | alt="" width="760" height="462" |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 724 | id="figure2" /> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 725 | <p class="img-caption"> |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 726 | <strong>Figure 2.</strong>HTML visualization generated by the Battery |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 727 | Historian tool. |
| 728 | </p> |
| 729 | |
| 730 | <p>For best results, you should first enable full wake lock reporting, to allow |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 731 | the Battery Historian tool to monitor uninterrupted over an extended period of |
| 732 | time:</p> |
| 733 | <pre> |
| 734 | $ adb shell dumpsys batterystats --enable full-wake-history |
| 735 | </pre> |
| 736 | |
| 737 | <p>You should also reset battery statistics at the beginning of a |
| 738 | measurement:</p> |
| 739 | <pre> |
| 740 | $ adb shell dumpsys batterystats --reset |
| 741 | </pre> |
| 742 | |
| 743 | <p>To generate an HTML visualization:</p> |
| 744 | <pre> |
| 745 | $ historian.par [-p powerfile] bugreport.txt > out.html |
| 746 | </pre> |
| 747 | </dd> |
| 748 | |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 749 | </dl> |
| 750 | |
| 751 | <h2 id="Enterprise">Enterprise</h2> |
| 752 | <h3 id="ManagedProvisioning">Managed provisioning</h3> |
| 753 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 754 | <div class="figure" style="width:360px"> |
| 755 | <img src="images/managed_apps_launcher.png" |
| 756 | srcset="images/managed_apps_launcher@2x.png 2x" |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 757 | alt="" width="360" height="609" id="figure3" /> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 758 | <p class="img-caption"> |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 759 | <strong>Figure 3.</strong> Launcher screen showing managed apps (marked with |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 760 | a lock badge) |
| 761 | </p> |
| 762 | </div> |
| 763 | |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 764 | <p>The L Developer Preview provides new functionality for running apps within |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 765 | an enterprise environment. A device administrator can |
| 766 | initiate a managed provisioning process to add a co-present but separate <em>managed |
| 767 | profile</em> to a device with an existing personal account. The administrator has |
| 768 | control over the managed profile.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 769 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 770 | <p>To start the managed provisioning process, send {@code |
| 771 | ACTION_PROVISION_MANAGED_PROFILE} in an {@link android.content.Intent}. If the |
| 772 | call is successful, the system triggers the {@code |
| 773 | android.app.admin.DeviceAdminReceiver. onProfileProvisioningComplete()} callback. |
| 774 | You can then call {@code app.admin.DevicePolicyManager. setProfileEnabled()} to |
| 775 | set this profile to the enabled state.</p> |
| 776 | |
| 777 | <p>A user may be associated with more than one managed profile. To get a list of |
| 778 | the managed profiles associated with the user, call |
| 779 | {@code android.os.UserManager. getUserProfiles()}.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 780 | |
| 781 | <p>Once a managed profile is created for a user, apps that are managed by the |
| 782 | device administrator will appear alongside non-managed apps in the user’s |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 783 | Launcher, Recent apps screen, and notifications.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 784 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 785 | <p>If you are developing a Launcher app, you can use the new {@code |
| 786 | android.content.pm.LauncherApps} class to get a list of launchable activities |
| 787 | for the current user and any associated managed profiles. Your Launcher can make |
| 788 | the managed apps visually prominent by appending a “work” badge to the icon |
| 789 | drawable with {@code android.os.UserManager.getBadgeDrawableForUser()}.</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 790 | |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 791 | <h3 id="TaskLocking">Task locking</h3> |
| 792 | <p>The L Developer Preview introduces a new task locking API that |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 793 | lets you temporarily restrict users from leaving your app or being interrupted |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 794 | by notifications. This could be used, for example, if you are developing an |
| 795 | education app to support high stakes assessment requirements on Android. |
| 796 | Once your app activates this mode, users will not be able to see |
| 797 | notifications, access other apps, or return to the Home screen, until your |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 798 | app exits the mode.</p> |
| 799 | |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 800 | <p>To prevent unauthorized usage, only authorized apps can activate task locking. |
| 801 | Furthermore, task locking authorization must be granted by a |
| 802 | specially-configured <em>device owner</em> app, through the {@code android.app.admin.DevicePolicyManager.setLockTaskComponents()} method.</p> |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 803 | |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 804 | <p>To set up a device owner, follow these steps:</p> |
| 805 | <ol> |
| 806 | <li>Attach a device running an <a href="https://source.android.com/source/building-running.html">Android {@code userdebug} build</a> to your development machine.</li> |
| 807 | <li>Install your device owner app.</li> |
| 808 | <li>Create a {@code device_owner.xml} file and save it to the {@code /data/system} |
| 809 | directory on the device. |
| 810 | <pre> |
| 811 | $ adb root |
| 812 | $ adb shell stop |
| 813 | $ rm /tmp/device_owner.xml |
| 814 | $ echo "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>" |
| 815 | >> /tmp/device_owner.xml |
| 816 | $ echo "&device-owner package=\"<your_device_owner_package>\" |
| 817 | name=\"*<your_organization_name>\" />" >> /tmp/device_owner.xml |
| 818 | $ adb push /tmp/device_owner.xml /data/system/device_owner.xml |
| 819 | $ adb reboot |
| 820 | </pre> |
| 821 | </li> |
| 822 | </ol> |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 823 | |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 824 | <p>Before using the task locking API in your app, verify that your activity is |
| 825 | authorized by calling {@code DevicePolicyManager.isLockTaskPermitted()}.</p> |
| 826 | |
| 827 | <p>To activate task locking, call |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 828 | {@code android.app.Activity.startLockTask()} from your authorized activity.</p> |
| 829 | |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 830 | <p>When task locking is active, the following behavior takes effect:</p> |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 831 | |
| 832 | <ul> |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 833 | <li>The status bar is blank, and user notifications and status information is |
| 834 | hidden.</li> |
| 835 | <li>The Home and Recent Apps buttons are hidden.</li> |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 836 | <li>Other apps may not launch new activities.</li> |
| 837 | <li>The current app may start new activities, as long as doing so does not |
| 838 | create new tasks.</li> |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 839 | <li>The user remains locked on your app until an authorized activity calls |
| 840 | {@code Activity.stopLockTask()}.</li> |
Quddus Chong | 1730564 | 2014-06-18 12:19:06 -0700 | [diff] [blame] | 841 | </ul> |
| 842 | |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 843 | <h2 id="Printing">Printing Framework</h2> |
| 844 | |
| 845 | <h3 id="PDFRender">Render PDF as bitmap</h3> |
| 846 | <p>You can now render PDF document pages into bitmap images for printing by |
| 847 | using the new {@code android.graphics.pdf.PdfRenderer} class. You must specify a |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 848 | {@link android.os.ParcelFileDescriptor} that is seekable (that is, the content |
| 849 | can be randomly accessed) on which the system writes the the printable content. |
| 850 | Your app can obtain a page for rendering with {@code openPage()}, then call |
| 851 | {@code render()} to turn the opened {@code PdfRenderer.Page} into a bitmap. You |
| 852 | can also set additional parameters if you only want to convert a portion of the |
| 853 | document into a bitmap image (for example, to implement |
| 854 | <a href="http://en.wikipedia.org/wiki/Tiled_rendering">tiled rendering</a> in |
| 855 | order to zoom in on the document).</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 856 | |
| 857 | <h2 id="TestingA11y">Testing & Accessibility </h2> |
| 858 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 859 | <h3 id="TestingA11yImprovements">Testing and accessibility improvements</h3> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 860 | <p>The L Developer Preview adds the following support for testing and |
| 861 | accessibility:</p> |
| 862 | |
| 863 | <ul> |
| 864 | <li>You can use the new {@code android.app.UiAutomation.getWindowAnimationFrameStats()} |
| 865 | and {@code android.app.UiAutomation.getWindowContentFrameStats()} methods to |
| 866 | capture frame statistics for window animations and content. This lets you |
| 867 | write instrumentation tests to evaluate if the app under test is rendering |
| 868 | frames at a sufficient refresh frequency to provide a smooth user experience. |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 869 | |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 870 | <li>You can execute shell commands from your instrumentation test with the new |
| 871 | {@code android.app.UiAutomation.executeShellCommand()}. The command execution |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 872 | is similar to running {@code adb shell} from a host connected to the device. This |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 873 | allows you to use shell based tools such as {@code dumpsys}, {@code am}, |
| 874 | {@code content}, and {@code pm}. |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 875 | |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 876 | <li>Accessibility services and test tools that use the accessibility APIs |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 877 | (such as <a href="{@docRoot}tools/help/uiautomator/index.html">uiautomator</a>) |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 878 | can now retrieve detailed information about the properties of windows on the |
| 879 | screen that sighted users can interact with. To retrieve a list of |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 880 | {@code android.view.accessibility.AccessibilityWindowInfo} objects |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 881 | representing the windows information, call the new |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 882 | {@code android.accessibilityservice.AccessibilityService.getWindows()} method. |
| 883 | <li>You can use the new {@code android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction} to define standard or customized |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 884 | actions to perform on an {@link android.view.accessibility.AccessibilityNodeInfo}. |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 885 | The new {@code AccessibilityAction} class replaces the actions-related APIs |
| 886 | previously found in {@code AccessibilityNodeInfo}. |
| 887 | </ul> |
| 888 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 889 | <h2 id="Manifest">Manifest Declarations</h2> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 890 | |
| 891 | <h3 id="ManifestFeatures">Declarable required features</h3> |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 892 | <p>The following values are now supported in the |
| 893 | <a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a> |
| 894 | element, so you can ensure that your app is installed only on devices that provide the features |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 895 | your app needs.</p> |
| 896 | |
| 897 | <ul> |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 898 | <li>{@code FEATURE_LEANBACK}. Declares that your app must be installed only on |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 899 | devices that support the |
| 900 | <a href="{@docRoot}training/tv/index.html}">Android TV</a> user interface. |
| 901 | Example: |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 902 | <pre> |
| 903 | <uses-feature android:name="android.software.leanback" |
| 904 | android:required="true" /> |
| 905 | </pre> |
| 906 | |
Andrew Solovay | 68990cf | 2014-06-15 20:26:07 -0700 | [diff] [blame] | 907 | <li>{@code FEATURE_WEBVIEW}. Declares that your app must only be installed on |
| 908 | devices that fully implement the {@code android.webkit.*} APIs. Example: |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 909 | <pre> |
| 910 | <uses-feature android:name="android.software.webview" |
| 911 | android:required="true" /> |
| 912 | </pre> |
| 913 | </ul> |
| 914 | |
| 915 | <h3 id="ManifestPermissions">User permissions</h3> |
Quddus Chong | aa9d778 | 2014-06-19 16:16:10 -0700 | [diff] [blame^] | 916 | <p>The following values are now supported in the |
| 917 | <a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">{@code |
| 918 | <uses-permission>}</a> to declare the |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 919 | permissions your app requires in order to access certain APIs. |
| 920 | |
| 921 | <ul> |
| 922 | <li>{@code SIM_COMMUNICATION}. Required to communicate with a SIM card using |
| 923 | logical channels. |
| 924 | </ul> |