Android Studio 2.0 (abril de 2016)

Observação: se você estiver desenvolvendo para a prévia para desenvolvedores N, use a versão de pré-lançamento do Android Studio 2.1. O Android Studio 2.0 não oferece suporte a todos os recursos necessários para ser a prévia N

Instant Run:

  • O Android Studio agora implanta builds limpos mais rápido do que nunca. Além disso, o envio de mudanças de código incremental para o emulador ou dispositivo físico é quase instantâneo. Revise suas atualizações sem reimplantar um novo build de depuração ou, em muitos casos, sem reiniciar o app.
  • <li>Instant Run supports pushing the following changes to a running app:
      <ul>
        <li>Changes to the implementation of an existing instance method or
        static method
        </li>
        <li>Changes to an existing app resource
        </li>
        <li>Changes to structural code, such as a method signature or a static
        field (requires a target device running API level 21 or higher).
        </li>
      </ul>
    </li>
    
    <li>Read the documentation to learn more <a href=
    "/tools/building/building-studio.html#instant-run">about Instant
    Run</a>.
      <p class="note">
        <strong>Note:</strong> Instant Run is supported only when you deploy the
        debug build variant, use <a href=
        "/tools/revisions/gradle-plugin.html#revisions">Android plugin for
        Gradle version 2.0.0</a> or higher, and configure your app's module-level
        <code>build.gradle</code> file for <code>minSdkVersion 15</code> or higher.
        For the best performance, configure your app for <code>minSdkVersion
        21</code> or higher.
      </p>
    </li>
    

Novidades no lint:

  • Inspeção de instruções switch usando inteiros anotados @IntDef para garantir que todas as constantes sejam processadas. Para adicionar instruções ausentes com rapidez, use o menu suspenso de ações de intent e selecione Add Missing @IntDef Constants.
  • Flags de tentativas incorretas de usar interpolação de string para inserir números de versão no arquivo build.gradle.
  • Sinalizações para classes anônimas que estendem a classe Fragment.
  • Flags de código nativo em locais não seguros, como as pastas res/ e asset/. Essa flag incentiva o armazenamento de código nativo na pasta libs/, que é então empacotada de forma segura na pasta data/app-lib/ do aplicativo no momento da instalação (AOSP: 169950).
  • Flags para chamadas não seguras para Runtime.load() e System.load() (AOSP: 179980).
  • Encontre e remova recursos não utilizados selecionando Refactor > Remove Unused Resources na barra de menus. A detecção de recursos não utilizados agora oferece suporte a recursos referenciados apenas por recursos não utilizados, referências em arquivos brutos, como de imagens .html, e atributos tools:keep e tools:discard usados pelo redutor de recursos do Gradle, considerando conjuntos de origem inativos (por exemplo, recursos usados em outras variações de build) e processando adequadamente importações de campo estático.
  • Verifica se referências implícitas da API têm suporte em todas as plataformas segmentadas por minSdkVersion.
  • Sinaliza o uso indevido de RecyclerView e Parcelable.
  • As inspeções @IntDef, @IntRange e @Size agora também são verificadas para matrizes e varargs int.

Outras melhorias:

  • Otimizado para o Android Emulator 2.0, que está mais rápido do que nunca, oferece suporte a uma maior variedade de dispositivos virtuais e apresenta uma interface significativamente aprimorada. Para saber mais sobre o novo emulador, leia as notas da versão das Ferramentas do SDK.
  • <li>Improvements to the <a href=
    "/tools/devices/managing-avds.html">Android Virtual Device
    Manager</a>:
      <ul>
        <li>System images are now categorized under the following tabs:
        <em>Recommended</em>, <em>x86</em>, and <em>Other</em>.
        </li>
        <li>Under advanced settings, you can enable multi-core support and
        specify the number of cores the emulator can use.
        </li>
        <li>Under advanced settings, you can determine how graphics are rendered
        on the emulator by selecting one of the following options:
          <ul>
            <li>
              <strong>Hardware:</strong> use you computer's graphics card for
              faster rendering.
            </li>
            <li>
              <strong>Software:</strong> use software-based rendering.
            </li>
            <li>
              <strong>Auto:</strong> let the emulator decide the best option. This
              is the default setting.
            </li>
          </ul>
        </li>
      </ul>
    </li>
    
    <li>Improved AAPT packaging times by specifying deploy target before the app
    is built. This allows Android Studio to efficiently package only the
    resources required by the specified device.
    </li>
    
    <li>Added Cloud Test Lab integration to provide on-demand app testing with
    the convenience and scalability of a cloud service. Learn more about how you
    can <a href="/training/testing/start/index.html#run-ctl">use Cloud
    Test Lab with Android Studio</a>.
    </li>
    
    <li>Added a preview of the new <a class="external-link" href=
    "//tools.android.com/tech-docs/gpu-profiler">GPU Debugger</a>. For graphics
    intensive applications, you can now visually step through your OpenGL ES code
    to optimize your app or game.
    </li>
    
    <li>Added Google App Indexing Test. Add support for URLs, app
    indexing, and search functionality to your apps to help drive more
    traffic to your app, discover which app content is used most, and attract
    new users. Test and validate URLs in your app all within Android
    Studio. See <a href=
    "/tools/help/app-link-indexing.html">Supporting URLs and App
      Indexing in Android Studio</a>.
    </li>
    
    <li>Upgrades from the latest IntelliJ 15 release, including improved code
    analysis and performance. See <a class="external-link" href=
    "https://www.jetbrains.com/idea/whatsnew">What's New in IntelliJ</a> for a
    complete description of the new features and enhancements.
    </li>
    
    <li>XML editor auto-complete now adds quotations marks when completing
    attributes. To check if this option is enabled, open the <b>Setting</b> or
    <b>Preferences</b> dialogue, navigate to <b>Editor &gt; General &gt; Smart
    Keys</b>, and check the box next to <b>Add quotes for attribute value on
    attribute completion</b>. <a class="external-link" href=
    "//b.android.com/195113">Issue: 195113</a>
    </li>
    
    <li>The XML editor now supports code completion for <a href=
    "/topic/libraries/data-binding/index.html#layout_details">data binding</a>
    expressions.
    </li>