Screenshot of Layout Inspector from Android Studio
This feature will work only if you run your app on a device with API level 30 or higher. Of course, this all looks very cool, but to be frank, you could safely do without it, so you can’t say that this is a change that completely changed the lives of developers. Even more than that, I think few people will use this, if not when creating Ui elements.
Build Analyzer
When using Android Studio 4.0 with Android Gradle plugin 4.0.0 and higher, the Build Analyzer window helps you understand and diagnose issues with your build process, such as disabled optimizations and improperly configured tasks. You could find it under the Build button as the last option. Here is the screenshot from Android Studio, how this element looks like.
Screenshot of Build Analyzer from Android Studio
The Build Analyzer window organizes possible build issues in a tree on the left. You can inspect and click on each issue to investigate its details in the panel on the right. Also, you could see the Warning there, in our case there are no warnings, so nothing to show.
Dependencies updates
There are two changes regarding the dependencies. The first one is with metadata. Android Gradle plugin starting from version 4.0.0 includes metadata that describes the dependencies that are compiled into your app. When you upload your app to the Play Console, it inspects this metadata to provide you the alerts about issues in dependencies you used in your app and to receive feedback to resolve these issues. Now, if you will decide not to share this information, you could add these extra lines to your build.gradle.
The second change is with feature-on-feature dependencies. Starting from Gradle version 4.0.0 you could include a feature that depends on another feature. For example, your app could contain two features, like a camera and audio. And there is one another feature, that depends on the camera, in this case, it should depend on the app too. Here is the build.gradleexample for video module.
CPU profiler updates
CPU profiler was added much earlier and after a time Google decided to improve it based on developers’ feedback. There are a lot of small changes, so I will not dive into each of them. Here is the list of changes added to the new Android Studio.
Screenshot of CPU Profiler from Android Studio
- CPU recordings are now separated from the main profiler timeline to allow for easier analysis. Recorded data are organized in groups on the left side of the Profiler window.
- For easier side-by-side analysis, you can now view all thread activity in the thread activity timeline
- The tabs for Flame Chart, Top-Down, and Bottom-Up analyses are now in the righthand column.
- In the Threads group, threads are automatically expanded for System Trace recordings and collapsed by default for other recording types.
- Events are now uniquely colored for easier differentiation.
- Threads are sorted by the number of trace events within them so that the “busier” threads are ranked higher in the list.
Other changes in a few words
There is a new tool for layout validation, which is a visual tool for simultaneously previewing layouts on different devices and configurations. By the way, you could do that even before, but now it’s on one page and you do not need to change the devices, definitely become better and more convenient.
Gif from the Android Developers website
Also, Google improved the code editor and it becomes smarter. Although it’s worth recognizing that the Android Studio already had a very smart editor, so now everything will become much easier and more convenient for developers.
Android Studio now added Motion Editor, making it easier to create animations. The Motion Editor provides a simple interface for manipulating elements from the MotionLayout library that serves as the foundation for animation in Android apps.
Conclusion
Summing up, I want to note that the new changes have definitely added more features to the developers and I hope they will facilitate the work of many.
If there are any important updates that we didn’t write about, you can share them in the comments and tell us why they seem important and necessary for you.