译文1——Android Studio 3.2.1的更新内容

前言

Android Studio 的3.2版本出来很久,今天终于升级了。更新成功之后,Android Studio 会弹出一个更新内容的英文版,我就想翻译一下。如果译文里面有错误,麻烦看到的小伙伴跟我说一下,我去更正。谢谢!

原文

What New in 3.2

This panel describes some of the new features and behavior changes included in this update.

To open this panel again later, select Help > What's New in Android Studio from the main menu.

Watch an overview

Read in a browser

Support for Android App Bundles

The Android App Bundle is a new upload format that includes all your app’s compiled code and resources, but defers APK generation and signing to the Google Play Store.

Google Play’s new app serving model, called Dynamic Delivery, then uses your app bundle to generate and serve optimized APKs for each user’s device configuration, so they download only the code and resources they need to run your app. You no longer have to build, sign, and manage multiple APKs, and users get smaller, more optimized downloads.

Additionally, you can add dynamic feature modules to your app project and include them in your app bundle. Through Dynamic Delivery, your users can then download and install your app’s dynamic features on-demand.

To learn more about how to build Android App Bundles, read the official documentation in a browser.

Support for Android Jetpack

Android Jetpack helps accelerate Android development with components, tools and guidance that eliminate repetitive tasks, and enables you to more quickly and easily build high-quality, testable apps. Android Studio includes the following updates to support Jetpack. For more details, read the official documentation in a browser.

  - New Navigation Editor: A visual editor for the XML resource that the new Navigation Component uses to handle navigation actions at runtime. The Navigation Editor is an experimental feature, so you must first enable it by opening the IDE Settings/Preferences dialog, selecting Experimental in the left pane, and checking the box next to Enable Navigation Editor. Learn more
  - New template for Architecture Components: Easily add the new Architecture Components to your project, such as the ViewModel, using the New Project Wizard. Learn more
  - AndroidX migration tools: The new Android extension libraries (AndroidX) represent the future of the Android Support Library. You can easily migrate an existing project to use AndroidX (including migrating Maven dependencies that do not yet use AndroidX) by selecting Refactor > Migrate to AndroidX. Learn more

New Profiler Features

The Android Profiler   now includes the following new features: 

 - Energy Profiler: Estimates your app's energy usage of a device's CPU, Network, and GPS resources. This new profiler also highlights background events that may contribute to battery drain, such as wake locks, alarms, jobs, and location requests. Learn more
 - System Trace: In the CPU Profiler, inspect your device's system CPU and thread activity using the new System Trace configuration. It's built on systrace and is useful for investigating system-level issues, such as UI jank. Learn more
 - Sessions: Inspect and revisit data across multiple profiler "sessions". Learn more
 - Export CPU trace files: After you record CPU activity with the CPU profiler, export the data as a .trace file by right-clicking on the recording in the CPU timeline and selecting Export trace from the context menu. Learn more
 - Import and inspect CPU trace files: Import and inspect .trace files that you create using the Debug API or CPU profiler (however, importing System Trace recordings is currently not supported). Import your trace file by clicking Start a new profiling session   in the profiler's Sessions pane and then selecting Load from file. Learn more
 - Record CPU activity during app startup: Enable the feature by selecting Run > Edit Configurations from the main menu and, under the Profiling tab of your desired run configuration, checking the box next to Start recording a method trace on startup. Now deploy your app to a device running Android 8.0 (API level 26) or higher by selecting Run > Profile. Learn more
 - Inspect JNI references: Inspect memory allocations for your app’s JNI code when you deploy to a device running Android 8.0 (API level 26) or higher. Learn more
 - Start method traces using the Debug API: Call Debug.startMethodTracing(String tracePath) and Debug.stopMethodTracing() in your app's code to programmatically start and stop recording method traces in the CPU profiler. Learn more

Android Emulator Snapshots

Using the Android Emulator 27.3.0 or higher, you can now save and load snapshots of an AVD (Android virtual device) at any time, making it fast and easy to return to a known state for testing. You can also edit an AVD using the AVD Manager to specify a default snapshot to load when the AVD starts.

Controls for saving, loading, and managing AVD snapshots are now in the Snapshots tab in the emulator's Extended controls window. Learn more 

C/C++ IDE Features

Android Studio now includes the following features for developing your C/C++ libraries:

 - Smart editor features for CMake scripts: Perform safe refactoring, code completion, code reformatting, and other smart editor actions when editing CMake build scripts. Learn more
 - Navigate external header files: In the Project window, view and inspect header files from external C/C++ library dependencies that you import into your project using CMake. Learn more

Other New Features and Behaviors

 - Base IDE upgraded to IntelliJ 2018.1.2: Android Studio now includes updates up through to IntelliJ 2018.1.2. You may notice changes in behavior and performance as a result of this merge.
 - Preview with sample data in the Layout Editor: Use auto-generated sample data to preview your views in the Layout Editor. In the editor's design view, click the   button and, in the pop-up menu that appears, select the type of content you want to use. Learn more
 - AAPT2 now on Google's Maven repo: To use AAPT2, you must add Google's Maven repository to your project-level build.gradle, as shown below. Learn more
	 buildscript.repositories {
         google()
   		 jcenter()
  		  ...
	}
	allprojects.repositories {
   		 google()
    	 jcenter()
   		 ...
	} 
 - New code shrinker: Preview a new code shrinker that also obfuscates by adding the line below to your project’s gradle.properties file. Learn more 
		android.enableR8 = true
 - Lint checks for Java/Kotlin interoperability: Enable new lint checks that enforce best practices described in the Kotlin Interop Guide by first opening the IDE preferences dialog and navigating to Editor > Inspections. Then, check the rules that you want to enable under Kotlin Interoperability. Learn more
 - Native multi-dex enabled by default: The Android plugin for Gradle now enables native multidex for all modules that set minSdkVersion = 21 or higher.
 - Changed set of default ABIs: When building multiple per-ABI APKs, Android plugin for Gradle 3.2.0 no longer generates APKs for the following ABIs by default: mips, mips64, and armeabi. Learn more

译文

3.2更新了什么

该面板描述了更新中包含的一些新特性和行为变化。
要再次打开这个面板,请选择Help>主菜单中的What's New in Android Studio

观看概览

在浏览器中阅读

支持Android App Bundles

Android App Bundle是一种新的上传格式,包括所有应用程序编译的代码和资源,但是推迟了APK的生成和签名到Google Play Store。

Google Play的新应用程序服务模型,称为Dynamic Delivery,然后使用您的应用程序包为每个用户的设备配置生成和服务优化的APK,因此它们只下载运行应用程序所需的代码和资源。您不再需要构建、签署和管理多个APK,用户可以获得更小、更优化的下载。

另外,您可以向应用程序项目添加动态特性模块,并将其包含在应用程序包中。通过动态传递,用户可以根据需要下载和安装应用程序的动态特性。

要了解更多关于如何构建Android App Bundles,请阅读浏览器中的官方文档。

支持Android Jetpack

Android Jetpack通过消除重复任务的组件、工具和指导,帮助加速Android开发,并使您能够更快更容易地构建高质量的、可测试的应用程序。Android Studio包含支持Jetpack的以下更新。有关详细信息,请阅读浏览器中的官方文档。

  • New Navigation Editor:用于XML资源的可视化编辑器,新Navigation组件使用该编辑器来在运行时处理导航操作。导航编辑器是一个实验特性,因此您必须首先通过打开IDE设置/首选项对话框、在左窗格中选择ExpigationEditor并选中Enable Navigation Editor旁边的框来启用它。了解更多
  • 架构组件的新模板:使用New Project Wizard轻松地将新的架构组件添加到项目中,例如ViewModel。了解更多
  • Android X迁移工具:新的Android扩展库(Android X)代表了Android支持库的未来。通过选择主菜单中的Refactor>Migrate to AndroidX,您可以轻松地迁移现有项目以使用AndroidX(包括迁移尚未使用AndroidX的Maven依赖项)。了解更多

分析器新特征

Android分析器现在包含了以下新特性:

  • 能源概况:估计应用程序的能源使用的设备的CPU,网络和GPS资源。这个新的剖析器还突出了可能导致电池耗尽的背景事件,如唤醒锁、警报、作业和位置请求。了解更多
  • 系统跟踪:在CPU剖析器中,使用新的系统跟踪配置检查设备的系统CPU和线程活动。它建立在系统上,对于研究系统级问题,如用户界面非常有用。了解更多
  • Sessions:检查和重访多个分析器“sessions”中的数据。了解更多
  • 导出CPU跟踪文件:在使用CPU分析器记录CPU活动之后,通过右键单击CPU时间线中的记录并从上下文菜单中选择导出跟踪,将数据导出为.trace文件。了解更多
  • 导入和检查CPU跟踪文件:导入和检查使用Debug API或CPU分析器创建的.跟踪文件(但是,当前不支持导入系统跟踪记录)。通过单击“分析器的会话”窗格中的“启动新的分析会话”,然后从“文件”中选择“加载”,导入跟踪文件。了解更多
  • 在应用程序启动期间记录CPU活动:通过从主菜单中选择Run>Edit Configurations并在所需运行配置的Profiling选项卡下选中Start旁边的框来启用该特性,现在将你的应用程序部署到运行Android 8(API级别26)或更高的设备上,通过选择Run>Profile。了解更多
  • 检查JNI引用:当您部署到运行Android 8(API级别26)或更高的设备时,检查应用程序的JNI代码的内存分配。了解更多
  • 使用调试API启动方法跟踪:在应用程序的代码中调用Debug.startMethodTracing(String tracePath)和Debug.stopMethodTracing(),以编程方式启动和停止在CPU分析器中记录方法跟踪。了解更多

Android模拟器快速启动

使用Android模拟器27.3.0或更高版本,现在可以随时保存和加载AVD(Android虚拟设备)的快速启动,从而快速且容易地返回到已知状态以进行测试。还可以使用AVD管理器编辑AVD,以指定在AVD启动时加载的默认快速启动。

用于保存、加载和管理AVD快速启动的控件现在在模拟器的扩展控件窗口中的快速启动选项卡中。了解更多

C/C++ IDE的特点

Android Studio现在包含了开发C/C++库的以下特性:

  • CMake脚本的智能编辑器特性:在编辑CMake构建脚本时执行安全重构、代码完成、代码重新格式化和其他智能编辑器操作。了解更多
  • 导航外部头文件:在项目窗口中,查看和检查使用cFube导入到项目中的外部C/C++库依赖项的头文件。了解更多

其他新的特征和行为

  • Base IDE升级到IntelliJ 2018.1.2:Android Studio现在包括升级到IntelliJ 2018.1.2的更新。您可能会注意到这种合并行为和性能的变化。
  • 在布局编辑器中预览示例数据:使用自动生成的示例数据在布局编辑器中预览视图。在编辑器的设计视图中,单击按钮,在出现的弹出菜单中,选择要使用的内容类型。了解更多
  • AAPT2:要使用AAPT2,必须将Google的Maven存储库添加到项目级别build.gradle中,如下所示。了解更多
buildscript.repositories {
    google()
    jcenter()
    ...
}
allprojects.repositories {
    google()
    jcenter()
    ...
}
  • 新代码收缩器:预览一个新代码收缩器,通过将下面的行添加到项目的gradle.properties文件中,该代码收缩器也会混淆。了解更多
android.enableR8 = true
  • 对Java/Kotlin interoperability的Lict检查:通过首先打开IDE首选项对话框并导航到Editor>Inspections,启用执行Kotlin Interop Guide中描述的最佳实践的新lint检查。然后,检查在Kotlin Interoperability下要启用的规则。了解更多
  • 默认情况下启用本机多重dex:Gradle的Android插件现在为设置minSdkVersion=21或更高的所有模块启用本机多重dex。
  • 更改了默认ABI设置:当构建多个每个ABI APK时,用于Gradle 3.2.0的Android插件在默认情况下不再为下列ABI生成APK:mipsmips64armeabi。了解更多

猜你喜欢

转载自blog.csdn.net/chengxu_kuangrexintu/article/details/83144963
今日推荐