Home | History | Annotate | Download | only in nougat
      1 page.title=  
      2 page.keywords=preview,sdk,compatibility
      3 meta.tags=" ", ""
      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"> Doze</a></li>
     18       <li><a href="#bg-opt">  </a></li>
     19     </ol>
     20   </li>
     21   <li><a href="#perm"> </a></li>
     22   <li><a href="#accessibility">  </a>
     23     <ol>
     24       <li><a href="#screen-zoom"> </a></li>
     25       <li><a href="#vision-settings">Vision Settings   </a></li>
     26     </ol>
     27   </li>
     28   <li><a href="#ndk">  NDK   </a></li>
     29   <li><a href="#afw">Android for Work</a></li>
     30 </ol>
     31 
     32 <h2></h2>
     33 <ol>
     34   <li><a href="{@docRoot}preview/api-overview.html"> API- AndroidN</a>
     35 </li>
     36 </ol>
     37 
     38 </div>
     39 </div>
     40 
     41 
     42 <p>
     43          AndroidN   
     44    API.       
     45 ,        .
     46 
     47 </p>
     48 
     49 <p>
     50         Android,    ,
     51             .
     52 </p>
     53 
     54 
     55 <h2 id="perf"> </h2>
     56 
     57 <p>
     58       AndroidN       
     59   ,      .    
     60          .  
     61      ,          .
     62 
     63 </p>
     64 
     65 <h3 id="doze"> Doze</h3>
     66 
     67 <p>
     68     Android6.0 ( API23),  Doze   ,
     69     ,      ,
     70  ,    . AndroidN  
     71  Doze,       
     72   ,      ,   ,    ,
     73 ,      .
     74 </p>
     75 
     76 
     77 <img src="{@docRoot}images/android-7.0/doze-diagram-1.png" alt="" height="251px" id="figure1" />
     78 <p class="img-caption">
     79   <strong>.1.</strong>          Doze
     80    .
     81 </p>
     82 
     83 <p>
     84                ,
     85     Doze      :   
     86  ,     .  
     87           Doze,  
     88   Doze  {@link android.os.PowerManager.WakeLock},
     89  {@link android.app.AlarmManager},  GPS  Wi-Fi.   ,  
     90       Doze,       ,
     91       
     92      .
     93 </p>
     94 
     95 
     96 <img src="{@docRoot}images/android-7.0/doze-diagram-2.png" alt="" id="figure2" />
     97 <p class="img-caption">
     98   <strong>.2.</strong>          Doze
     99  ,       .
    100 </p>
    101 
    102 <p>
    103    ,         
    104      Doze 
    105    .    
    106           
    107   Doze  Android6.0 ( API23),     
    108 <a href="{@docRoot}training/monitoring-device-state/doze-standby.html">   Doze     </a>.
    109      (,  Google Cloud Messaging (GCM)
    110     )          
    111 Doze.
    112 </p>
    113 
    114 
    115 <h3 id="bg-opt"> Svelte:   </h3>
    116 
    117 <p>
    118    AndroidN        
    119    .     ,  
    120     ,    
    121  .        
    122    .
    123 </p>
    124 
    125 <p>
    126          , ,  
    127  Wi-Fi   .      
    128 ,         {@link
    129   android.net.ConnectivityManager#CONNECTIVITY_ACTION}   .
    130        , 
    131          .
    132 
    133 </p>
    134 
    135 <p>
    136             {@link
    137   android.hardware.Camera#ACTION_NEW_PICTURE}  {@link
    138   android.hardware.Camera#ACTION_NEW_VIDEO}   ,   .
    139        ,   
    140    .
    141 </p>
    142 
    143 <p>
    144       AndroidN  
    145  .
    146 </p>
    147 
    148 <ul>
    149   <li>  AndroidN     {@link
    150   android.net.ConnectivityManager#CONNECTIVITY_ACTION},     
    151       .    
    152     {@code CONNECTIVITY_CHANGE}  
    153  ,      {@link
    154   android.content.BroadcastReceiver}.
    155   </li>
    156 
    157   <li>        {@link
    158   android.hardware.Camera#ACTION_NEW_PICTURE}  {@link
    159   android.hardware.Camera#ACTION_NEW_VIDEO}.      ,  ,     AndroidN.
    160 
    161   </li>
    162 </ul>
    163 
    164 <p>
    165      Android       ,
    166       .    
    167 (  )         
    168   .
    169 </p>
    170 
    171 <p>
    172    Android   ,    
    173      . ,  API {@link
    174   android.app.job.JobScheduler}      ,
    175      ,      .     {@link
    176   android.app.job.JobScheduler},      .
    177 
    178 </p>
    179 
    180 <p>
    181            
    182      <a href="{@docRoot}preview/features/background-optimization.html">  </a>.
    183 
    184 </p>
    185 
    186 
    187 <h2 id="perm"> </h2>
    188 
    189 <p>
    190    AndroidN   ,      ,
    191          
    192   .     ,  
    193  .
    194 </p>
    195 
    196 <ul>
    197   <li>{@code GET_ACCOUNTS} ()
    198     <p>
    199        GET_ACCOUNTS   .    
    200  ,   AndroidN.
    201     </p>
    202   </li>
    203 
    204 </ul>
    205 
    206 
    207 
    208 <h2 id="accessibility">  </h2>
    209 
    210 <p>
    211    AndroidN  ,        
    212     .    
    213      ,     
    214     ,       
    215 .
    216 </p>
    217 
    218 
    219 <h3 id="screen-zoom"> </h3>
    220 
    221 <p>
    222   AndroidN     <strong>Display size</strong>,    
    223    ,      
    224     .        
    225 <a href="http://developer.android.com/guide/topics/resources/providing-resources.html">  sw320dp</a> (  Nexus4,    ).
    226 
    227 </p>
    228 
    229 <div class="cols">
    230 
    231 <div class="col-6">
    232   <img src="{@docRoot}images/android-7.0/screen-zoom-1.png" alt="" height="XXX" id="figure1" />
    233 </div>
    234 <div class="col-6">
    235   <img src="{@docRoot}images/android-7.0/screen-zoom-2.png" alt="" height="XXX" id="figure1" />
    236 </div>
    237 
    238 </div> <!-- end cols -->
    239 <p class="img-caption">
    240   <strong>.3.</strong>     
    241   Display size     AndroidN.
    242 </p>
    243 
    244 
    245 <p>
    246             .
    247 
    248 </p>
    249 
    250 <ul>
    251   <li>    API  23  ,   
    252    .  ,       
    253   <em>Settings</em>   
    254 <strong>Display size</strong>,        ,
    255     .     ,    ,
    256           
    257 <a href="{@docRoot}guide/topics/resources/runtime-changes.html"> 
    258   </a>,      .
    259   </li>
    260 
    261   <li>    AndroidN,   
    262 (  )    ,     
    263 <a href="{@docRoot}guide/topics/resources/runtime-changes.html">    </a>.
    264 
    265   </li>
    266 </ul>
    267 
    268 <p>
    269       -       ,
    270         Android.    .
    271 </p>
    272 
    273 <ul>
    274   <li>        <code><a href=
    275   "{@docRoot}guide/topics/resources/providing-resources.html">sw320dp</a></code>
    276      .
    277   </li>
    278 
    279   <li>        ,    ,
    280       ,   .
    281   ,       .
    282 
    283     <p class="note">
    284       <strong>.</strong>    ,   , 
    285     , , ,   
    286      .    ,
    287        .
    288 
    289     </p>
    290   </li>
    291 
    292   <li>     ,         .
    293      <a href="{@docRoot}guide/practices/screens_support.html">   </a> (<code>dp</code>).
    294 
    295   </li>
    296 </ul>
    297 
    298 <h3 id="vision-settings">Vision Settings   </h3>
    299 
    300 <p>
    301    AndroidN   Vision Settings   ,    
    302       :
    303 <strong>Magnification gesture</strong>, <strong>Font size</strong>,
    304 <strong>Display size</strong>  <strong>TalkBack</strong>.    
    305    ,     . 
    306    ,    ,   
    307   <strong>Settings&gt;
    308 Accessibility</strong>.
    309 </p>
    310 
    311 <h2 id="ndk">  NDK   </h2>
    312 
    313 <p>
    314    AndroidN    ,    API-.
    315    NDK,       API-  Android.
    316   API     Android
    317        .
    318 </p>
    319 
    320 <p>
    321         API, ,     AndroidN,
    322        (logcat)    API.
    323          ,   .
    324     ,   
    325  API     
    326    .
    327 </p>
    328 
    329 <p>
    330         ,    NDK
    331       API   .
    332      ,   ,
    333      ,     (,
    334 <code>libpng</code>),      NDK.    ,  
    335  APK    .so,     .
    336 </p>
    337 
    338 <p class="caution">
    339   <strong>!</strong>       
    340 API. ,   ,        
    341   Android.
    342 </p>
    343 
    344 <p>
    345          (  ),     
    346 NDK,           Android.
    347        OpenSSL  BoringSSL.
    348        , 
    349   ,   
    350 NDK,    .          NDK    ,   
    351     Android API.
    352 </p>
    353 
    354 <p>
    355               Java  NDK,
    356          AndroidN.
    357 </p>
    358 
    359 <p>  Java:</p>
    360 <pre class="no-pretty-print">
    361 java.lang.UnsatisfiedLinkError: dlopen failed: library "/system/lib/libcutils.so"
    362     is not accessible for the namespace "classloader-namespace"
    363 </pre>
    364 
    365 <p>  NDK:</p>
    366 <pre class="no-pretty-print">
    367 dlopen failed: cannot locate symbol "__system_property_get" referenced by ...
    368 </pre>
    369 
    370 
    371 <p>
    372            .
    373 </p>
    374 
    375 <ul>
    376   <li> getJavaVM  getJNIEnv  libandroid_runtime.so   
    377   JNI:
    378 <pre class="no-pretty-print">
    379 AndroidRuntime::getJavaVM -&gt; GetJavaVM from &lt;jni.h&gt;
    380 AndroidRuntime::getJNIEnv -&gt; JavaVM::GetEnv or
    381 JavaVM::AttachCurrentThread from &lt;jni.h&gt;.
    382 </pre>
    383   </li>
    384 
    385   <li>  {@code property_get}  {@code libcutils.so}  
    386    {@code __system_property_get}.
    387    {@code __system_property_get}    include:
    388 <pre>
    389 #include &lt;sys/system_properties.h&gt;
    390 </pre>
    391   </li>
    392 
    393   <li>  {@code SSL_ctrl}  {@code libcrypto.so}     .
    394 ,    
    395 {@code libcyrpto.a}    {@code .so}        
    396 {@code libcrypto.so}  BoringSSL  OpenSSL.
    397   </li>
    398 </ul>
    399 
    400 <h2 id="afw">Android for Work</h2>
    401 <p>
    402   AndroidN    ,   Android for Work,    ,
    403  ,   ,
    404     .      
    405 Android for Work,        
    406   .
    407 </p>
    408 
    409 <ul>
    410   <li>     ,   DPC   .
    411       ,   NSDK,  
    412    ,     
    413 (DPC)  
    414 <code>DevicePolicyManager.setCertInstallerPackage()</code>.    
    415   
    416 <code>IllegalArgumentException</code>.
    417   </li>
    418 
    419   <li>         
    420 .      
    421 <code>DevicePolicyManager.resetPassword()</code>    
    422  .  -   ,   ,     
    423 , PIN-   .
    424   </li>
    425 
    426   <li>           .
    427    API-   
    428      <code>DISALLOW_MODIFY_ACCOUNTS</code>.
    429   </li>
    430 
    431   <li>      .  
    432     ,    <code>DISALLOW_ADD_USER</code>.
    433      .
    434  ,    <code>CreateUser()</code> 
    435 <code>createAndInitial()</code>,    
    436 <code>DevicePolicyManager.createAndManageUser()</code>.
    437   </li>
    438 
    439   <li>      .     MAC-
    440 Wi-Fi  ,  
    441 <code>DevicePolicyManagewr.getWifiMacAddress()</code>.   Wi-Fi   
    442  ,     {@code null}.
    443   </li>
    444 </ul>
    445 
    446 <p>
    447       Android for Work  AndroidN   
    448 <a href="{@docRoot}preview/features/afw.html"> Android for Work</a>.
    449 </p>
    450 
    451 <h2 id="other">  </h2>
    452 
    453 <ul>
    454 <li> ,   AndroidN,    API   ,
    455 ,     . 
    456     .       ,  
    457      .
    458 
    459 <p>
    460       ,
    461       .
    462      ,
    463      DDMS.
    464 </p>
    465 
    466 <p>
    467   N    Android       ,
    468        .
    469 </p>
    470 </li>
    471 
    472 <li>
    473   AndroidN      
    474         .     ,
    475    (<strong>Setting</strong>&gt;
    476 <strong>Display</strong>&gt; <strong>Font size</strong>)    
    477    .
    478 </li>
    479 </ul>
    480 
    481