For Android developers, Android Studio is our preferred development tool. It is based on the powerful IntelliJ IDEA development, so it inherits many advantages of IDEA, but also adds some Android development plug-ins and features. For our Android program development has brought convenience.
The latest stable release of Android Studio is 4.1, and 4.2 has been released into the Beta channel. However, version 4.2 will be the last version of Android Studio’s digital naming. After that, Google will adopt new naming rules for Android Studio. Changed the name of the first version to Android Studio Arctic Fox (2020.3.1). Currently, Android Studio Artic Fox has arrived in Canary channel and iterated to Canary3.
Android Studio’s new version naming rules
Starting with Arctic Fox (2020.3.1), the new Android Studio releases will be based on year, The Android Studio version number scheme will follow the following pattern:
<Year of IntelliJ Version>.<IntelliJ major version>.<Studio major version>.<Studio minor/patch version>
Copy the code
-
The first two sets of numbers represent which version of the IntelliJ IDEA platform Android Studio is based on. For example, for the first version after the name change, it is: 2020.3
-
The third set of numbers represents the Studio major release, starting at 1 and incrementing each major release by 1;
-
The fourth number group represents Studio minor/patch releases, starting at 1 and incrementing by 1 for each minor release.
-
For ease of referencing each version, we also provide A code name for the main version, increasing from A to Z by animal name. The new initial release is called Arctic Fox.
If the previous numbering system is used, this release will be Android Studio 4.3. The new numbering system now calls it Android Studio Arctic Fox (2020.3.1) Canary 1, or Arctic Fox for short.
Why change the naming scheme?
Officials gave the following reasons:
-
1. The new name is more consistent with the naming specification of IntelliJ IDEA and aligned with IntelliJ IDEA.
-
2. The new name brings more visibility to developers, such as knowing which IDEA version Relsease is based on
New version numbering scheme for Android Gradle plugin
In addition to the Android Studio naming rules, Android Gradle Plugin has also changed the version number scheme. The latest release of Grandle Plugin is 4.1, and after 4.2, it goes directly to AGP 7.0.0.
AS we all know, the Gradle plugin version is always consistent with the AS version. This change will decouple the AGP version from the Android Studio version. Gradle versions will no longer follow the major version changes and release rhythms of Android Studio. After AGP7.0 Gradle will have its own major annual release, one major release per year.
In AGP7.0, the principle of semantic versioning is adopted and is consistent with the Gradle version required for AGP. Compatibility between Android Studio and Android Gradle plug-ins does not change. Enables developers to open projects using stable AGP using newer versions of Android Studio.
For a full introduction to APG7.0, take a look at this official introduction blog post:
Android-developers.googleblog.com/2020/12/ann…
What’s new in Arctic Fox?
Data Binding supports StateFlow
For Kotlin apps that use coroutines, you can now use the StateFlow object as a data binding source to automatically notify the UI of data changes. Your data binding will be life-cycle aware and will only fire when the UI is displayed on the screen.
To use a StateFlow object with a bound class, you need to specify a Lifecycle Owner to define the scope of the StateFlow object and then, in the layout, use bound expressions to assign the properties and methods of the ViewModel component to the corresponding views, as shown in the following example:
class ViewModel() {
val username: StateFlow<String>
}
Copy the code
<TextView
android:id="@+id/name"
android:text="@{viewmodel.username}" />
Copy the code
If you are using Androidx, StateFlow is automatically included in the data binding functionality, including coroutine dependencies.
2. New WorkManager inspector
In previous versions of Android Studio, we introduced a Database Inspector that helps developers understand and debug databases. The Database Inspector is based on an APP Inspector system. It supports many different Inspector types, such as the WorkManager Inspector described below.
In Arctic Fox Canary3 or later, you can use the WorkManager Inspector feature. When using the Workmanger library 2.5.0-Beta2 and later, you can use the WorkManager Inspector. It can help you detect, debug, and visualize background tasks in your App.
You can then select a task from the table to view more details, such as a description of the task, how it is executed, details of its worker chain, and the execution results of the task.
To see a visual of a task chain, select a task from the task list and click Show Graph View from the toolbar. Then you can select any task in the chain to see details or stop.
3. Jetpack Compose tool support
Android Studio Arctic Fox adds support for Jetapck Compose preview and testing.
Preview:
The @preview method adds several parameters:
showBackground
: Select open/close background for previewbackgroundColor
: Sets a background color that only works during preview- This new parameter can take any
Configuration.UI_ *
Constant and allows you to change the preview behavior to: night mode to see how the subject reacts.
Release to device preview:
Use this feature to deploy UI fragments to the device. This will help test a small part of the code on the device without having to launch the entire application.
Layout Validation Tool
The new Layout Validation Tool in Arctic Fox allows you to see how your Layout responds in various screen sizes, font sizes, and Android color correction/color blindness modes. You can experience this functionality through the Layout Validation tool window while using the Layout editor.
ADB wireless debugging function
For people running the latest version of Android Platform tools on macOS (which will support other platforms soon) and Android 11 devices, You can go to the Run button’s device selection dialog box → Pair Devices Using Wi-Fi to try out the ADB wireless debugging features integrated into the IDE.
Wireless ADB Setup Window interface:
Accessibility Scanner for Layout Editor
Android Studio now integrates with the Android Accessibility Testing Framework to help you find accessibility issues in your layout. When you use the Layout Editor, click on the Accessibility Scanner button to enable scanning. The tool also provides suggestions for fixing common problems such as lack of content instructions.
Accessibility Scanner is available starting with Canary8
conclusion
That’s all for this article, including the new naming scheme for Android Studio, the new version management scheme for AGP and some new features for Android Studio Arctic Fox. The version is still in Canary channel, and there is still some distance from the official version. The new features in this article are also some of the new features that have been revealed on the official blog so far. There may be some changes in the final version. If you are interested in the changes in the new version, Check out the Preview Note for Android Studio, which includes Canary, Beta, and other features and bug fixes.
Address: androidstudio.googleblog.com/2020/12/and…
AS for the name of the new AS, everyone has different opinions. AS for developer visibility, developers don’t really care. Do you care which IntelliJ IDEA version the new AS version is based on? But the interesting thing is that the first version will be called Arctic Fox, the next version will be named after the a-Z animal, and the second version will not be called Brown Bear. Android’s traditional name-guessing game is back. Remember that the tradition of guessing which dessert Android would be codenamed with before every Google IO was abolished last year with Android 10. Now it’s all coming back.
reference
- Android-developers.googleblog.com/2020/12/ann…
- Developer.android.com/studio/prev…
- Android-developers.googleblog.com/2020/12/ann…
I am Xi Ge, more Android original articles, please pay attention to the public number “technology TOP”