1 page.title=Android N for Developers 2 meta.tags="preview", "androidn" 3 page.tags="preview", "developer preview" 4 page.image=images/cards/card-n-apis_2x.png 5 @jd:body 6 7 8 9 10 <div id="tb-wrapper"> 11 <div id="tb"> 12 <h2></h2> 13 <ol> 14 <ul style="list-style-type:none;"> 15 <li><a href="#multi-window_support"></a></li> 16 <li><a href="#notification_enhancements"></a></li> 17 <li><a href="#jit_aot">JIT/AOT </a></li> 18 <li><a href="#quick_path_to_app_install"></a></li> 19 <li><a href="#doze_on_the_go"></a></li> 20 <li><a href="#background_optimizations"></a></li> 21 <li><a href="#data_saver">Data Saver</a></li> 22 <li><a href="#vulkan">Vulkan API</a></li> 23 <li><a href="#tile_api">Quick Settings Tile API</a></li> 24 <li><a href="#number-blocking"></a></li> 25 <li><a href="#call_screening"></a></li> 26 <li><a href="#multi-locale_languages"></a></li> 27 <li><a href="#emoji"></a></li> 28 <li><a href="#icu4">Android ICU4J API</a></li> 29 <li><a href="#gles_32">OpenGL ES 3.2 API</a></li> 30 <li><a href="#android_tv_recording">Android TV </a></li> 31 <li><a href="#android_for_work">Android for Work</a></li> 32 <li><a href="#accessibility_enhancements"></a></li> 33 <li><a href="#direct_boot"></a></li> 34 <li><a href="#key_attestation"></a></li> 35 <li><a href="#network_security_config"></a></li> 36 <li><a href="#default_trusted_ca"> CA</a></li> 37 <li><a href="#apk_signature_v2">APK Signature Scheme v2</a></li> 38 <li><a href="#scoped_directory_access"></a></li> 39 <li><a href="#keyboard_shortcuts_helper"></a></li> 40 <li><a href="#sustained_performance_api"> API</a></li> 41 <li><a href="#vr">VR </a></li> 42 <li><a href="#print_svc"></a></li> 43 <li><a href="#virtual_files"></a></li> 44 <li><a href="#framemetrics_api">FrameMetricsListener API</a></li> 45 </ol> 46 </div> 47 </div> 48 49 50 51 <p>Android N N Developer Preview 52 53 </p> 54 55 <p> 56 <a href="{@docRoot}preview/behavior-changes.html"></a> <a href="{@docRoot}preview/setup-sdk.html#docs-dl">API </a> API 57 58 59 60 </p> 61 62 <h2 id="multi-window_support"></h2> 63 64 65 <p> Android N — 66 </p> 67 68 <p> </p> 69 <ul> 70 <li> Android N 71 72 73 </li> 74 75 <li> Android TV <a href="{@docRoot}preview/features/picture-in-picture.html"></a> 76 77 </li> 78 </ul> 79 80 <div class="col-4of10"> 81 <img src="{@docRoot}images/android-7.0/mw-portrait.png" alt="" style="height:460px;padding-left:1em;" id="img-split-screen" /> 82 <p class="img-caption"> 83 <strong> 1. </strong> 84 </p> 85 86 </div> 87 88 <p> 89 — 90 91 </p> 92 93 <p> 94 Activity Activity 95 96 97 </p> 98 99 <p> 100 <a href="{@docRoot}preview/features/multi-window.html"></a> 101 102 </p> 103 104 <h2 id="notification_enhancements"></h2> 105 106 <p> Android N 107 </p> 108 109 <ul> 110 <li> 111 <strong></strong> 112 113 114 </li> 115 116 <li> 117 <strong></strong> <code>MessageStyle</code> 118 119 120 121 </li> 122 123 <li> 124 <strong></strong> 125 Dismiss Archive 126 Android Wear 127 128 129 </li> 130 131 <li> 132 <strong></strong>Android 133 134 135 </li> 136 137 <li> 138 <strong></strong> API 139 140 141 </li> 142 </ul> 143 144 <div class="col-4of12"> 145 <img src="{@docRoot}images/android-7.0/notifications-1.png" alt="" style="padding:.5em;max-width:226px"> 146 </div> 147 148 <div class="col-4of12"> 149 <img src="{@docRoot}images/android-7.0/notifications-3.png" alt="" style="padding:.5em;max-width:226px"> 150 </div> 151 152 <div class="col-4of12"> 153 <img src="{@docRoot}images/android-7.0/notifications-2.png" alt="" style="padding:.5em;max-width:226px"> 154 </div> 155 156 157 <p class="img-caption"> 158 <strong> 2. </strong> 159 </p> 160 161 <p><a href="{@docRoot}preview/features/notification-updates.html"></a> 162 163 </p> 164 165 166 167 <h2 id="jit_aot"> JIT/AOT </h2> 168 169 <p> Android N Just in Time (JIT) ART Android 170 171 JIT Android Ahead of Time (AOT) 172 173 </p> 174 175 <p> Android AOT/JIT 176 Android 177 178 179 </p> 180 181 <p> RAM 182 183 </p> 184 185 <p>Android 186 187 </p> 188 189 <h2 id="quick_path_to_app_install"></h2> 190 191 <p>Android JIT 192 Android 6.0 193 194 </p> 195 196 <h2 id="doze_on_the_go">...</h2> 197 198 <p>Android 6.0 CPU 199 200 </p> 201 202 <p> Android N CPU 203 204 205 206 </p> 207 208 209 <img src="/preview/images/doze-diagram-1.png" alt="" id="figure1" /> 210 <p class="img-caption"> 211 <strong> 3. </strong> 212 213 </p> 214 215 216 <p> 217 / 218 219 220 </p> 221 222 <p> {@link 223 android.os.PowerManager.WakeLock}{@link android.app.AlarmManager} GPS/Wi-Fi CPU 224 225 </p> 226 227 <p> 228 229 <a href="{@docRoot}training/monitoring-device-state/doze-standby.html#assessing_your_app"></a> 230 </p> 231 232 <h2 id="background_optimizations">Project Svelte</h2> 233 234 <p>Project Svelte Android RAM 235 Android N Project Svelte 236 </p> 237 238 <p> — RAM 239 240 241 </p> 242 243 <p> Android 5.0 {@link android.app.job.JobScheduler} 244 245 246 JobScheduler 247 </p> 248 249 <p> 250 <a href="https://developers.google.com/android/reference/com/google/android/gms/gcm/GcmNetworkManager"> 251 <code>GCMNetworkManager</code></a>Google Play Android 252 253 254 </p> 255 256 <p> <code>JobScheduler</code> 257 <code>GCMNetworkManager</code> — Android N 258 259 260 261 </p> 262 263 <p> Android N — 264 {@link android.net.ConnectivityManager#CONNECTIVITY_ACTION}{@link 265 android.hardware.Camera#ACTION_NEW_PICTURE} {@link 266 android.hardware.Camera#ACTION_NEW_VIDEO} — 267 N Developer Preview <code>JobScheduler</code> API 268 269 </p> 270 271 <p> 272 <a href="{@docRoot}preview/features/background-optimization.html"></a> 273 274 </p> 275 276 277 <h2 id="data_saver">Data Saver</h2> 278 279 <div class="col-5of12" style="margin-right:1.5em;"> 280 <img src="{@docRoot}images/android-7.0/datasaver.png" style="border:2px solid #ddd"> 281 282 <p class="img-caption" style="padding-right:2em;"> 283 <strong> 4. </strong> Data Saver 284 </p> 285 </div> 286 287 <p> 288 289 </p> 290 291 <p>Android N Data Saver 292 293 Data Saver Data Saver 294 295 </p> 296 297 <p> <strong>Settings</strong> Data Saver — 298 299 300 301 Data Saver 302 </p> 303 304 <p>Android N {@link android.net.ConnectivityManager}<a href="{@docRoot}preview/features/data-saver.html#status"> Data Saver </a><a href="{@docRoot}preview/features/data-saver.html#monitor-changes"></a> 305 306 307 Data Saver 308 </p> 309 310 311 <h2 id="vulkan">Vulkan API</h2> 312 313 <p> 314 Android N 3D API <a href="http://www.khronos.org/vulkan" class="external-link">Vulkan</a> <a href="https://www.khronos.org/opengles/" class="external-link">OpenGL ES</a> Vulkan 3D Khronos Group 315 316 317 318 </p> 319 320 <p> 321 Vulkan CPU GPU 322 Vulkan 323 324 325 </p> 326 327 <p> 328 Vulkan Android NDK 329 330 </p> 331 332 <ul> 333 <li> 334 </li> 335 336 <li> 337 </li> 338 339 <li>SPIR-V 340 </li> 341 342 <li>SPIR-V 343 </li> 344 </ul> 345 346 <p> 347 Vulkan Vulkan Nexus 5XNexus 6P Nexus Player 348 Vulkan 349 350 </p> 351 352 <p> 353 <a href="{@docRoot}ndk/guides/graphics/index.html">API </a> 354 </p> 355 356 <h2 id="tile_api">Quick Settings Tile API</h2> 357 358 359 <div style="float:right;max-width:320px"> 360 <img src="{@docRoot}images/android-7.0/quicksettings.png" style="padding-left:1.5em;"> 361 362 <p class="img-caption" style="padding-left:2em;"> 363 <strong> 5.</strong> 364 </p> 365 366 367 </div><p> 368 Android N 369 </p> 370 371 <p> 372 — 373 374 </p> 375 376 <p>Android N API 377 </p> 378 379 <p> 380 381 382 383 </p> 384 385 <p> 386 387 388 </p> 389 390 <p> 391 <a href="{@docRoot}preview/setup-sdk.html#docs-dl">API </a> <code>android.service.quicksettings.Tile</code> 392 393 </p> 394 395 396 397 <h2 id="number-blocking"></h2> 398 399 <p>Android N API 400 401 402 </p> 403 404 <p>Android 405 406 </p> 407 408 <ul> 409 <li> 410 <li> Backup & Restore 411 412 <li> 413 </ul> 414 415 <p> Android VOIP 416 417 418 </p> 419 420 <p> 421 <a href="{@docRoot}preview/setup-sdk.html#docs-dl">API </a> <code>android.provider.BlockedNumberContract</code> 422 423 424 </p> 425 426 <h2 id="call_screening"></h2> 427 428 <p> 429 Android N <code>CallScreeningService</code> {@link android.telecom.Call.Details Call.Details} 430 431 432 433 </p> 434 435 <ul> 436 <li> 437 <li> 438 <li> 439 </ul> 440 441 <p> 442 <a href="{@docRoot}preview/setup-sdk.html#docs-dl">API </a> <code>android.telecom.CallScreeningService</code> 443 444 445 </p> 446 447 448 <h2 id="multi-locale_languages"></h2> 449 450 451 <p>Android N <strong></strong> 452 API — 453 454 455 456 </p> 457 458 <p>Android N 459 25 460 100 461 </p> 462 463 <p> <code>LocaleList.GetDefault()</code> 464 Android N 465 466 </p> 467 468 <p><a href="{@docRoot}preview/features/multilingual-support.html"></a> 469 </p> 470 471 472 <h2 id="emoji"></h2> 473 474 <p> 475 Android N 476 477 478 479 </p> 480 481 <ul> 482 <li> 483 <strong></strong> 484 {@link android.graphics.Paint#hasGlyph(String)} 485 486 </li> 487 <li> 488 <strong></strong> 489 490 491 492 493 494 <a class="external-link" href="http://www.unicode.org/Public/9.0.0/ucd/StandardizedVariants-9.0.0d1.txt"> Unicode </a> <em></em> 495 496 497 498 </li> 499 <li> 500 <strong></strong>Android N 501 502 503 {@link android.graphics.Paint#hasGlyph(String)} 504 505 <a class="external-link" href="http://unicode.org/emoji/charts/full-emoji-list.html">Unicode </a> 506 507 508 </li> 509 </ul> 510 511 512 <h2 id="icu4">Android ICU4J API</h2> 513 514 <p> 515 Android N Android <code>android.icu</code> <a href="http://site.icu-project.org/">ICU4J</a> API 516 <code>com.java.icu</code> <code>android.icu</code> 517 518 ICU4J Android <code>android.icu</code> API APK 519 520 521 </p> 522 523 <p> 524 Android ICU4J API <a href="{@docRoot}preview/features/icu4j-framework.html">ICU4J </a> 525 </p> 526 527 528 529 <h2 id="gles_32">OpenGL™ ES 3.2 API</h2> 530 531 <p>Android N OpenGL ES 3.2 </p> 532 533 <ul> 534 <li> <a class="external-link" href="https://www.khronos.org/registry/gles/extensions/ANDROID/ANDROID_extension_pack_es31a.txt"> 535 Android </a></a> (AEP) <code>EXT_texture_sRGB_decode</code> 536 <li> HDR 537 <li> BaseVertex 538 <li> WebGL 539 </ul> 540 541 <p>Android N OpenGL ES 3.2 API <code>GLES32</code> 542 OpenGL ES 3.2 <code><uses-feature></code> <code>android:glEsVersion</code> 543 544 </p> 545 546 <p> OpenGL ES OpenGL ES <a href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL ES API </a> 547 </p> 548 549 550 <h2 id="android_tv_recording">Android TV </h2> 551 552 <p>Android N API Android TV 553 API TV 554 555 </p> 556 557 <p> <a href="{@docRoot}preview/features/tv-recording-api.html">Android TV API</a></p> 558 559 560 <h2 id="android_for_work">Android for Work</h2> 561 562 <p>Android for Work Android N API— <a href="{@docRoot}preview/features/afw.html">Android for Work </a> 563 564 </p> 565 566 <h3 id="work_profile_security_challenge"> </h3> 567 568 <p> 569 N SDK 570 571 572 573 <code>ACTION_SET_NEW_PASSWORD</code> <code>ACTION_SET_NEW_PARENT_PROFILE_PASSWORD</code> 574 575 576 577 </p> 578 579 <p> 580 <code>setPasswordQuality()</code><code>setPasswordMinimumLength()</code> PIN 581 582 583 <code>getParentProfileInstance()</code> <code>DevicePolicyManager</code> 584 585 586 <code>setOrganizationColor()</code> <code>setOrganizationName()</code> 587 588 589 </p> 590 <h3 id="turn_off_work"> </h3> 591 592 <p> 593 594 595 596 597 </p> 598 599 <h3 id="always_on_vpn">Always on VPN </h3> 600 601 <p> VPN 602 VPN 603 </p> 604 605 <p> 606 <code>DevicePolicyManager</code> <code>setAlwaysOnVpnPackage()</code> <code>getAlwaysOnVpnPackage()</code> 607 608 609 </p> 610 611 <p> VPN VPN Always on VPN 612 Intent <code>android.net.VpnService</code> 613 614 </p> 615 616 <p> 617 <strong>Settings>More>Vpn</strong> <code>VPNService</code> Always on VPN 618 619 620 </p> 621 622 <h3 id="custom_provisioning"></h3> 623 624 <p> 625 <code>DevicePolicyManager.EXTRA_PROVISIONING_MAIN_COLOR</code> <code>DevicePolicyManager.EXTRA_PROVISIONING_LOGO_URI</code> 626 627 628 629 630 </p> 631 632 <h2 id="accessibility_enhancements"></h2> 633 634 <p>Android N Vision Settings 635 TalkBack 636 637 </p> 638 639 <p> 640 641 Settings > Accessibility 642 </p> 643 644 <p> Android N 645 API 646 647 </p> 648 649 <p> <a href="{@docRoot}preview/setup-sdk.html#docs-dl">API </a> <code>android.accessibilityservice.GestureDescription 650 </code></p> 651 652 653 <h2 id="direct_boot"></h2> 654 655 <p> 656 657 658 659 660 </p> 661 662 <p> Android N 663 664 665 666 </p> 667 668 <p> 669 670 671 <code>LOCKED_BOOT_COMPLETED</code> Intent 672 673 674 675 </p> 676 677 <a href="{@docRoot}preview/features/direct-boot.html"></a></p> 678 </p> 679 680 681 <h2 id="key_attestation"></h2> 682 683 <p> Android 684 Linux Android 685 686 </p> 687 688 <p>Android N 689 RSA EC 690 691 692 </p> 693 694 <p> X.509 695 696 ECDSA 697 698 699 700 </p> 701 702 <p> Android <a class="external-link" href="https://source.android.com/security/verifiedboot/verified-boot.html#bootloader_requirements">bootloader</a> <a class="external-link" href="https://source.android.com/security/trusty/index.html"> (TEE)</a> 703 704 705 </p> 706 707 <ul> 708 <li></li> 709 <li><a href="https://source.android.com/security/verifiedboot/index.html" class="external-link"></a></li> 710 </ul> 711 712 <p><a href="https://source.android.com/security/keystore/" class="external-link"></a> 713 </p> 714 715 <p>Android N 716 </p> 717 718 <h2 id="network_security_config"></h2> 719 720 <p> Android N APIX509TrustManagerHTTPSTLS 721 722 723 <em></em></p> 724 725 <p></p> 726 <ul> 727 <li><b></b> (CA) 728 CA 729 730 </li> 731 <li><b></b> 732 733 734 </li> 735 <li><b></b> 736 </li> 737 <li><b></b> 738 </li> 739 </ul> 740 741 <p><a href="{@docRoot}preview/features/security-config.html"></a> 742 </p> 743 744 <h2 id="default_trusted_ca"></h2> 745 746 <p> Android N (CA) 747 Android N CA<a href="{@docRoot}preview/features/security-config.html"></a> CA 748 749 750 </p> 751 752 <h2 id="apk_signature_v2">APK signature scheme v2</h2> 753 754 <p> 755 Android N APK Signature Scheme v2 APK 756 757 Android Studio 2.2 Android Gradle 2.2 APK Signature Scheme v2 758 759 760 </p> 761 762 <p> 763 APK Signature Scheme v2 764 APK Signature Scheme v2 765 Android Studio 2.2 Android Gradle 2.2 766 767 <code>build.gradle</code> <code>v2SigningEnabled false</code> 768 769 770 771 </p> 772 773 <pre> 774 android { 775 ... 776 defaultConfig { ... } 777 signingConfigs { 778 release { 779 storeFile file("myreleasekey.keystore") 780 storePassword "password" 781 keyAlias "MyReleaseKey" 782 keyPassword "password" 783 <strong>v2SigningEnabled false</strong> 784 } 785 } 786 } 787 </pre> 788 789 <p class="caution"><strong></strong> APK Signature Scheme v2 790 791 APK Signature Scheme v2 <code>zipalign</code> 792 793 </p> 794 795 <p> 796 Android Studio <a href="{@docRoot}studio/publish/app-signing.html#release-mode"></a> Android Gradle <a href="{@docRoot}studio/build/build-variants.html#signing"></a> 797 798 799 800 </p> 801 802 <h2 id="scoped_directory_access"></h2> 803 804 <p> Android N API <a href="{@docRoot}guide/topics/data/data-storage.html#filesExternal"></a> SD 805 806 API <code>Pictures</code> 807 API <code>READ_EXTERNAL_STORAGE</code> 808 809 810 811 </p> 812 813 <p> API 814 API UI 815 816 </p> 817 818 <p><a href="{@docRoot}preview/features/scoped-folder-access.html"></a> 819 820 </p> 821 822 <h2 id="keyboard_shortcuts_helper"></h2> 823 824 <p> 825 Android N Alt + / 826 827 <em></em> 828 829 <code>Activity.onProvideKeyboardShortcuts()</code> <a href="{@docRoot}preview/setup-sdk.html#docs-dl">API </a> 830 831 832 </p> 833 834 <p> 835 {@code Activity.requestKeyboardShortcutsHelper()} 836 837 </p> 838 839 <h2 id="sustained_performance_api"> API</h2> 840 841 <p> 842 843 844 845 846 </p> 847 848 <p> 849 Android N (OEM) 850 851 <em></em> 852 853 854 </p> 855 856 <p> 857 Nexus 6P N Developer Preview API 858 859 860 {@code Window.setSustainedPerformanceMode()} 861 862 863 </p> 864 865 <h2 id="vr">VR </h2> 866 867 <p> 868 Android N VR VR 869 VR CPU VR 870 871 872 Android N 873 Android N VR <a href="https://developers.google.com/vr/android/"> Android Google VR SDK</a> 874 875 </p> 876 877 878 <h2 id="print_svc"></h2> 879 880 <p> 881 Android N 882 883 </p> 884 885 <p> 886 887 888 </p> 889 890 <ul> 891 <li> <code>PrinterInfo.Builder.setResourceIconId()</code> ID 892 893 </li> 894 895 <li> <code>PrinterInfo.Builder.setHasCustomPrinterIcon()</code> <code>android.printservice.PrinterDiscoverySession.onRequestCustomPrinterIcon()</code> 896 897 898 899 </li> 900 </ul> 901 902 <p> 903 <code>PrinterInfo.Builder.setInfoIntent()</code> 904 905 </p> 906 907 <p> 908 <code>android.printservice.PrintJob.setProgress()</code> <code>android.printservice.PrintJob.setStatus()</code> 909 910 911 912 </p> 913 914 <p> 915 <a href="{@docRoot}preview/setup-sdk.html#docs-dl">API </a> 916 </p> 917 918 <h2 id="framemetrics_api">FrameMetricsListener API</h2> 919 920 <p> 921 FrameMetricsListener API UI 922 API Pub/Sub API 923 <code><a href="{@docRoot}tools/help/shell.html#shellcommands">adb shell</a> 924 dumpsys gfxinfo framestats</code> 120 925 926 </p> 927 928 <p> 929 FrameMetricsListener UI USB 930 API {@code adb shell dumpsys gfxinfo} 931 932 933 934 935 UI 936 937 938 </p> 939 940 <p> 941 <code>FrameMetricsListener.onMetricsAvailable()</code> 942 <a href="{@docRoot}preview/setup-sdk.html#docs-dl">API </a> {@code FrameMetricsListener} 943 944 945 </p> 946 947 <p> 948 API {@code FrameMetrics} {@code UNKNOWN_DELAY_DURATION}{@code INPUT_HANDLING_DURATION}{@code ANIMATION_DURATION}{@code LAYOUT_MEASURE_DURATION}{@code DRAW_DURATION}{@code SYNC_DURATION}{@code COMMAND_ISSUE_DURATION}{@code SWAP_BUFFERS_DURATION}{@code TOTAL_DURATION} {@code FIRST_DRAW_FRAME} 949 950 951 952 953 954 955 </p> 956 957 958 <h2 id="virtual_files"></h2> 959 960 <p> 961 Android Google 962 963 964 965 966 </p> 967 968 <p> 969 Android N 970 <em></em> {@link android.provider.DocumentsProvider} {@link android.content.Intent#ACTION_VIEW}Intent URI 971 972 973 Android N 974 975 </p> 976 977 <p> 978 URI {@link android.content.Intent} UI 979 {@link android.content.ContentResolver#openInputStream(Uri) openInputStream()} {@link android.content.Intent#CATEGORY_OPENABLE} 980 981 982 983 984 </p> 985 986 <p> 987 {@link android.app.Activity#onActivityResult onActivityResult()} 988 989 URI 990 991 </p> 992 993 <pre> 994 // Other Activity code ... 995 996 final static private int REQUEST_CODE = 64; 997 998 // We listen to the OnActivityResult event to respond to the user's selection. 999 @Override 1000 public void onActivityResult(int requestCode, int resultCode, 1001 Intent resultData) { 1002 try { 1003 if (requestCode == REQUEST_CODE && 1004 resultCode == Activity.RESULT_OK) { 1005 1006 Uri uri = null; 1007 1008 if (resultData != null) { 1009 uri = resultData.getData(); 1010 1011 ContentResolver resolver = getContentResolver(); 1012 1013 // Before attempting to coerce a file into a MIME type, 1014 // check to see what alternative MIME types are available to 1015 // coerce this file into. 1016 String[] streamTypes = 1017 resolver.getStreamTypes(uri, "*/*"); 1018 1019 AssetFileDescriptor descriptor = 1020 resolver.openTypedAssetFileDescriptor( 1021 uri, 1022 streamTypes[0], 1023 null); 1024 1025 // Retrieve a stream to the virtual file. 1026 InputStream inputStream = descriptor.createInputStream(); 1027 } 1028 } 1029 } catch (Exception ex) { 1030 Log.e("EXCEPTION", "ERROR: ", ex); 1031 } 1032 } 1033 </pre> 1034 1035 <p> 1036 <a href="{@docRoot}guide/topics/providers/document-provider.html"></a> 1037 1038 1039 </p> 1040