1 page.title= 2 page.keywords=preview, sdk, 3 meta.tags="preview", "compatibility" 4 page.tags="preview", "developer preview" 5 page.image=images/cards/card-n-changes_2x.png 6 @jd:body 7 8 9 <div id="tb-wrapper"> 10 <div id="tb"> 11 12 <h2> </h2> 13 14 <ol> 15 <li><a href="#perf"> </a> 16 <ol> 17 <li><a href="#doze"> </a></li> 18 <li><a href="#bg-opt"> </a></li> 19 </ol> 20 </li> 21 <li><a href="#perm"> </a> 22 </li> 23 <li><a href="#sharing-files"> </a></li> 24 <li><a href="#accessibility"> </a> 25 <ol> 26 <li><a href="#screen-zoom"> /</a></li> 27 <li><a href="#vision-settings"> Vision Settings</a></li> 28 </ol> 29 </li> 30 <li><a href="#ndk"> NDK </a></li> 31 <li><a href="#afw">Android for Work</a></li> 32 <li><a href="#annotations"> </a></li> 33 <li><a href="#other"> </a></li> 34 </ol> 35 36 <h2> </h2> 37 <ol> 38 <li><a href="{@docRoot}preview/api-overview.html"> 39 Android N API </a></li> 40 </ol> 41 42 </div> 43 </div> 44 45 46 <p> 47 Android N 48 API . 49 50 . 51 </p> 52 53 <p> 54 Android , 55 . 56 </p> 57 58 59 <h2 id="perf"> </h2> 60 61 <p> 62 Android N RAM 63 . , 64 , 65 . 66 </p> 67 68 <h3 id="doze"> </h3> 69 70 <p> 71 Android 6.0(API 23) 72 CPU 73 . Android N 74 75 CPU 76 , (: ). 77 </p> 78 79 80 <img src="{@docRoot}images/android-7.0/doze-diagram-1.png" alt="" height="251px" id="figure1" /> 81 <p class="img-caption"> 82 <strong> 1.</strong> 83 . 84 </p> 85 86 <p> 87 88 . 89 , . 90 , {@link android.os.PowerManager.WakeLock}, 91 {@link android.app.AlarmManager} , GPS Wi-Fi 92 . 93 , 94 , 95 / . 96 </p> 97 98 99 <img src="{@docRoot}images/android-7.0/doze-diagram-2.png" alt="" id="figure2" /> 100 <p class="img-caption"> 101 <strong> 2.</strong> 102 . 103 </p> 104 105 <p> 106 107 . <a href="{@docRoot}training/monitoring-device-state/doze-standby.html"> 108 </a> , Android 6.0(API 23) 109 110 111 . 112 . , GCM(Google Cloud Messaging) 113 114 . 115 </p> 116 117 118 <h3 id="bg-opt">Project Svelte: </h3> 119 120 <p> 121 Android N 122 . 123 , 124 . 125 . 126 </p> 127 128 <p> 129 (: Wi-Fi 130 ). 131 {@link 132 android.net.ConnectivityManager#CONNECTIVITY_ACTION} 133 . 134 , 135 . 136 </p> 137 138 <p> 139 , Android (: ) {@link 140 android.hardware.Camera#ACTION_NEW_PICTURE} {@link 141 android.hardware.Camera#ACTION_NEW_VIDEO} 142 . , 143 . 144 </p> 145 146 <p> 147 , Android N 148 . 149 </p> 150 151 <ul> 152 <li>Android N {@link 153 android.net.ConnectivityManager#CONNECTIVITY_ACTION} 154 . 155 {@link android.content.BroadcastReceiver} 156 {@code CONNECTIVITY_CHANGE} . 157 </li> 158 159 <li> {@link 160 android.hardware.Camera#ACTION_NEW_PICTURE} {@link 161 android.hardware.Camera#ACTION_NEW_VIDEO} . Android N 162 . 163 </li> 164 </ul> 165 166 <p> , 167 Android N . 168 Android 169 . , {@link 170 android.app.job.JobScheduler} API (: 171 ) 172 . {@link 173 android.app.job.JobScheduler} . 174 </p> 175 176 <p> 177 N 178 <a href="{@docRoot}preview/features/background-optimization.html"> </a> 179 . 180 </p> 181 182 <h2 id="perm"> </h2> 183 184 <p> 185 Android N . 186 </p> 187 188 <h3 id="permfilesys"> </h3> 189 190 <p> 191 , Android N 192 (<code>0700</code>). 193 194 . . 195 </p> 196 197 <ul> 198 <li> 199 200 , 201 {@link android.content.Context#MODE_WORLD_READABLE} / 202 {@link android.content.Context#MODE_WORLD_WRITEABLE} 203 {@link java.lang.SecurityException} . 204 <p class="note"> 205 <strong>:</strong> . 206 207 API {@link java.io.File File} API . 208 . 209 </p> 210 </li> 211 <li> 212 <code>file://</code> URI 213 . 214 <code>file://</code> URI 215 <code>FileUriExposedException</code> . 216 {@link 217 android.support.v4.content.FileProvider} . 218 </li> 219 <li> 220 {@link android.app.DownloadManager} 221 . {@link 222 android.app.DownloadManager#COLUMN_LOCAL_FILENAME} 223 . Android N 224 {@link android.app.DownloadManager#COLUMN_LOCAL_FILENAME} {@link java.lang.SecurityException} 225 . 226 227 228 {@link 229 android.app.DownloadManager.Request#setDestinationInExternalFilesDir 230 DownloadManager.Request.setDestinationInExternalFilesDir()} 231 {@link 232 android.app.DownloadManager.Request#setDestinationInExternalPublicDir 233 DownloadManager.Request.setDestinationInExternalPublicDir()} 234 235 236 {@link android.app.DownloadManager#COLUMN_LOCAL_FILENAME} , 237 . {@link android.app.DownloadManager} 238 239 {@link android.content.ContentResolver#openFileDescriptor 240 ContentResolver.openFileDescriptor()} . 241 </li> 242 </ul> 243 244 <h2 id="sharing-files"> </h2> 245 246 <p> 247 Android N , Android {@code file://} URI 248 {@link android.os.StrictMode} API 249 . URI 250 {@code FileUriExposedException} . 251 </p> 252 253 <p> 254 {@code content://} URI 255 URI . 256 {@link android.support.v4.content.FileProvider} . 257 258 <a href="{@docRoot}training/secure-file-sharing/index.html"> </a> . 259 </p> 260 261 <h2 id="accessibility"> </h2> 262 263 <p> 264 Android N 265 . 266 , 267 268 . 269 </p> 270 271 272 <h3 id="screen-zoom"> /</h3> 273 274 <p> 275 Android N <strong>Display size</strong> 276 , , 277 . <a href="http://developer.android.com/guide/topics/resources/providing-resources.html">sw320dp</a> / 278 , Nexus 4 279 . 280 </p> 281 282 <div class="cols"> 283 284 <div class="col-6"> 285 <img src="{@docRoot}images/android-7.0/screen-zoom-1.png" alt="" height="XXX" id="figure1" /> 286 </div> 287 <div class="col-6"> 288 <img src="{@docRoot}images/android-7.0/screen-zoom-2.png" alt="" height="XXX" id="figure1" /> 289 </div> 290 291 </div> <!-- end cols --> 292 <p class="img-caption"> 293 <strong> 3.</strong> Android N 294 Display size . 295 </p> 296 297 298 <p> 299 300 . 301 </p> 302 303 <ul> 304 <li> API 23 305 . , 306 <em>Settings</em> 307 <strong>Display size</strong> , 308 . 309 , <a href="{@docRoot}guide/topics/resources/runtime-changes.html"> </a> , 310 311 . 312 </li> 313 314 <li> Android N , 315 <a href="{@docRoot}guide/topics/resources/runtime-changes.html"> </a> 316 , ( ) 317 . 318 </li> 319 </ul> 320 321 <p> 322 Android , 323 . . 324 </p> 325 326 <ul> 327 <li> <code><a href= 328 "{@docRoot}guide/topics/resources/providing-resources.html">sw320dp</a></code> 329 . 330 </li> 331 332 <li> , 333 (: ) 334 . 335 . 336 <p class="note"> 337 <strong>:</strong> , 338 339 . , 340 341 . 342 </p> 343 </li> 344 345 <li> 346 , . , <a href="{@docRoot}guide/practices/screens_support.html"> </a>(<code>dp</code>) 347 . 348 </li> 349 </ul> 350 351 <h3 id="vision-settings"> Vision Settings</h3> 352 353 <p> 354 Android N Welcome Vision Settings 355 , 356 <strong>Magnification gesture</strong>, <strong>Font size</strong>, 357 <strong>Display size</strong> <strong>TalkBack</strong> . 358 . , 359 360 . <strong>Settings > 361 Accessibility</strong> . 362 </p> 363 364 <h2 id="ndk"> NDK </h2> 365 366 <p> 367 API Android N . 368 NDK Android 369 API . Android API 370 . 371 </p> 372 373 <p> 374 API , Android N 375 API logcat . 376 , 377 . 378 API , 379 . 380 </p> 381 382 <p> 383 , API 384 API NDK . 385 , 386 , 387 (: <code>libpng</code>) NDK . 388 .so APK . 389 </p> 390 391 <p class="caution"> 392 <strong>:</strong> API 393 . , Android 394 . 395 </p> 396 397 <p> 398 NDK 399 . 400 Android . OpenSSL BoringSSL . 401 , NDK 402 , 403 . NDK 404 Android API . 405 </p> 406 407 <p> 408 , 409 Android N Java NDK . 410 </p> 411 412 <p>Java :</p> 413 <pre class="no-pretty-print"> 414 java.lang.UnsatisfiedLinkError: dlopen failed: library "/system/lib/libcutils.so" 415 is not accessible for the namespace "classloader-namespace" 416 </pre> 417 418 <p>NDK :</p> 419 <pre class="no-pretty-print"> 420 dlopen failed: cannot locate symbol "__system_property_get" referenced by ... 421 </pre> 422 423 424 <p> 425 . 426 </p> 427 428 <ul> 429 <li>libandroid_runtime.so getJavaVM getJNIEnv 430 JNI . 431 <pre class="no-pretty-print"> 432 AndroidRuntime::getJavaVM -> GetJavaVM from <jni.h> 433 AndroidRuntime::getJNIEnv -> JavaVM::GetEnv or 434 JavaVM::AttachCurrentThread from <jni.h>. 435 </pre> 436 </li> 437 438 <li>{@code libcutils.so} {@code property_get} 439 {@code alternative __system_property_get} . 440 , include {@code __system_property_get} . 441 <pre> 442 #include <sys/system_properties.h> 443 </pre> 444 </li> 445 446 <li>{@code libcrypto.so} {@code SSL_ctrl} 447 . , {@code .so} 448 {@code libcyrpto.a} BoringSSL OpenSSL 449 {@code libcrypto.so} . 450 </li> 451 </ul> 452 453 <h2 id="afw">Android for Work</h2> 454 <p> 455 Android N Android for Work 456 . , , 457 . Android for Work 458 459 . 460 </p> 461 462 <ul> 463 <li>DPC , 464 . N SDK 465 , (DPC) <code>DevicePolicyManager.setCertInstallerPackage()</code> 466 , 467 . 468 <code>IllegalArgumentException</code> 469 . 470 </li> 471 472 <li> 473 . 474 {@code DevicePolicyManager.resetPassword()} 475 . 476 , PIN . 477 </li> 478 479 <li> 480 . <code>DISALLOW_MODIFY_ACCOUNTS</code> 481 API . 482 </li> 483 484 <li> . 485 <code>DISALLOW_ADD_USER</code> 486 . 487 . , <code>CreateUser()</code> 488 <code>createAndInitializeUser()</code> , 489 <code>DevicePolicyManager.createAndManageUser()</code> . 490 </li> 491 492 <li> . 493 <code>DevicePolicyManagewr.getWifiMacAddress()</code> 494 Wi-Fi MAC . 495 Wi-Fi {@code null} . 496 </li> 497 498 <li>Work Mode . 499 . 500 . 501 </ul> 502 503 <p> 504 Android N Android for Work 505 <a href="{@docRoot}preview/features/afw.html">Android for Work </a> . 506 </p> 507 508 <h2 id="annotations"> </h2> 509 510 <p> 511 Android N . . 512 513 . 514 </p> 515 516 <ul> 517 <li>{@code VISIBILITY_BUILD}: .</li> 518 <li>{@code VISIBILITY_SYSTEM}: 519 .</li> 520 </ul> 521 522 <p> 523 , 524 . {@code @Retention(RetentionPolicy.RUNTIME)} . 525 </p> 526 527 <h2 id="other"> </h2> 528 529 <ul> 530 <li> Android N API 531 , . 532 . Recents 533 . 534 535 <p> 536 . 537 DDMS 538 539 . 540 </p> 541 542 <p> 543 N , 544 . 545 </p> 546 </li> 547 548 <li> 549 Android N , 550 . 551 (<strong>Setting</strong> > 552 <strong>Display</strong> > <strong>Font size</strong>) , Recents 553 . 554 </li> 555 556 <li> 557 Android , 558 TCP . Android N . 559 {@code android.os.NetworkOnMainThreadException} . 560 , 561 ANR (jank) , . 562 </li> 563 564 <li> 565 {@code Debug.startMethodTracing()} , 566 SD , 567 568 . , API {@code WRITE_EXTERNAL_STORAGE} . 569 </li> 570 571 <li> 572 API 573 {@link android.os.Binder} , 574 {@code TransactionTooLargeExceptions} 575 {@code RuntimeExceptions} . 576 577 {@link android.app.Activity#onSaveInstanceState Activity.onSaveInstanceState()} 578 , Android N {@code ActivityThread.StopInfo} 579 {@code RuntimeException} . 580 </li> 581 582 <li> 583 {@link java.lang.Runnable} {@link android.view.View} 584 {@link android.view.View} 585 , 586 {@link android.view.View} {@link java.lang.Runnable} , 587 {@link java.lang.Runnable} 588 {@link android.view.View} 589 . . 590 <ul> 591 <li> UI {@link android.view.View} , 592 {@link java.lang.Runnable} . 593 </li> 594 <li>{@link java.lang.Runnable} 595 {@link java.lang.Runnable} .</li> 596 </ul> 597 </li> 598 599 <li> 600 {@link android.Manifest.permission#DELETE_PACKAGES DELETE_PACKAGES} 601 602 Android N , 603 . 604 {@link android.content.pm.PackageInstaller#uninstall PackageInstaller.uninstall()} 605 {@link android.content.pm.PackageInstaller#STATUS_PENDING_USER_ACTION STATUS_PENDING_USER_ACTION} 606 . 607 </li> 608 609 </ul> 610 611