本文共 5998 字,大约阅读时间需要 19 分钟。
Android Studio 3.3 is the latest stable release. In this tutorial, we’ll discuss the new features available in this release. Google calls this update as Project Marble.
Android Studio 3.3是最新的稳定版本。 在本教程中,我们将讨论此版本中可用的新功能。 Google将此更新称为Project Marble。
The focus of Android Studio 3.3 is refinement and quality.
Android Studio 3.3的重点是完善和质量。
We can divide new features into following categories.
我们可以将新功能分为以下几类。
Let’s look into some of the important features in detail.
让我们详细研究一些重要功能。
This was available in the Android Studio Canary release before but was put on hold. It’s now finally available in a stable release.
之前,该版本在Android Studio Canary版本中可用,但已暂停。 现在终于可以在稳定版本中使用了。
We’ve already discussed and implemented Navigation Editor .
我们已经讨论和实现了导航编辑器。
The latest plugin version 3.3.1 is here with the Gradle Version 4.10. It comes with decreased build time. It improves support for incremental Java compilation when using annotation processors.
最新的插件版本3.3.1与Gradle版本4.10在一起。 它减少了构建时间。 使用注释处理器时,它改进了对增量Java编译的支持。
While creating a new application, there’s a different look of the project wizard and the activity template you choose.
创建新应用程序时,项目向导和您选择的活动模板的外观会有所不同。
You can select whether to use AndroidX or not as shown in the image below:
您可以选择是否使用AndroidX,如下图所示:
In the past updates of Android Studio, it was difficult to locate and remove the caches, settings of old Android Studio versions. Now, when you update the IDE, it allows you to delete the older ones.
在过去的Android Studio更新中,很难找到和删除旧Android Studio版本的缓存和设置。 现在,当您更新IDE时,它允许您删除较旧的IDE。
When syncing a project if there are some missing components, Gradle now automatically downloads them provided that you had permitted this.
同步项目时,如果缺少某些组件,Gradle现在会自动下载它们,前提是您允许这样做。
If your application is using obsolete APIs, Android Studio now provides more detailed debugging information on which part of your code is calling them. To enable this option, add the following line of code to a Gradle file:
如果您的应用程序使用的是过时的API,Android Studio现在会提供有关代码的哪一部分调用它们的更详细的调试信息。 要启用此选项,请将以下代码行添加到Gradle文件中:
android.debug.obsoleteApi = true.
If your project is configured with multiple build variants you can configure the IDE to sync only the active build thus saving lots of time.
如果您的项目配置有多个构建变体,则可以将IDE配置为仅同步活动的构建,从而节省大量时间。
You can now create Instant Apps for Android App Bundles.
您现在可以为Android应用程序捆绑包创建Instant Apps。
You can now use Dummy Data in UI elements like by setting Design Time View Attributes as demonstrated in the GIF below:
现在,您可以通过设置“设计时视图属性”来在UI元素(如使用虚拟数据,如下面的GIF所示:
Not only can you create a C++ native module from the project wizard, but you also have support for Clang-Tidy. Android Studio now includes support for static code analysis using Clang-Tidy. To enable this feature, update your NDK to r18 or higher.
您不仅可以通过项目向导创建C ++本机模块,而且还支持Clang-Tidy 。 Android Studio现在支持使用Clang-Tidy进行静态代码分析。 要启用此功能,请将您的NDK更新到r18或更高版本。
CMake 3.10.2 is now available from the SDK Manager. We can include it in the build.gradle file using the following code:
可以从SDK Manager中获得CMake 3.10.2。 我们可以使用以下代码将其包含在build.gradle文件中:
android { ... externalNativeBuild { cmake { ... version "3.10.2" } }}
Preview R8, a new code shrinker that also obfuscates the code. Add the following line in the gradle.properties
file.
预览版R8,这是一种新的代码收缩器,它也使代码模糊。 在gradle.properties
文件中添加以下行。
android.enableR8 = true
Network Profile now includes formatted text for certain data like JSON, XML, and HTML. Previously, it only displayed raw data.
网络配置文件现在包括某些数据(如JSON,XML和HTML)的格式化文本。 以前,它仅显示原始数据。
Slices provide a new way to embed portions of your app’s functionality in other user interface surfaces on Android. For example, Slices make it possible to show app functionality and content in Google Search Suggestions.
切片提供了一种将应用功能的一部分嵌入Android其他用户界面中的新方法。 例如,切片可以在Google搜索建议中显示应用功能和内容。
Last but not least, there’s a feedback screen at the bottom right to allow developers to send feedback.
最后但并非最不重要的一点是,右下角有一个反馈屏幕,允许开发人员发送反馈。
That brings an end to this tutorial. You can download Android Studio 3.3 from the official Download Page using this .
这样就结束了本教程。 您可以使用此从官方下载页面下载Android Studio 3.3。
翻译自:
转载地址:http://xvqzd.baihongyu.com/