What is new in Android Studio 4.2?

Android overhauled the CPU Profiler UI in Android Studio 4.0, to provide a more intuitive recording workflow. Based on your feedback we continued to make changes and added more features in 4.1. However, Android studio 4.1 has issues that need to be solved,More info visit:android app development course

Android studio 4.1 rundown of known issues

This section describes current known issues in an overview of Android Studio 4.1.

  • Patches which do not function in Canary 4.1 10

Patches are currently broken to Android Studio 4.1 Canary 10. To upgrade Android Studio 4.1 to a newer version, shut down Android Studio and then download and install the latest set.

This issue was fixed in Beta 1 of Android Studio 4.1.

Workaround for missing canary module Kotlin 9

You can note the following error in Android Studio 4.1 Canary 9 when you first launch Android Studio after upgrading.

  • Lack of critical org.jetbrains.android plug-in

This can occur when importing the settings from an earlier version of Android Studio. It typically means you have a Kotlin plugin installed locally, which is not compatible with the new IDE.

To fix this problem, delete the Kotlin directory from the locations below:

~/.local / share / Google / AndroidStudioPreview4.1 Linux:

C:\Users\UserName\AppData\Roaming\Google\AndroidStudioPreview4.1 Windows:

MacOS: ~/Library / Use / Google / AndroidStudioPreview4.1

Since there is no Kotlin plugin currently available from JetBrains that is compatible with Canary 9, we have bundled our own Kotlin plugin with the Canary 9 update, so you don’t need to install a Kotlin plugin manually.

  • Errors in CPU Profiler on timeout

When choosing the Sample Java Methods or Trace Java Methods configurations, you can encounter errors in the Android Studio CPU Profiler “Recording failed to stop” These are often timeout errors, particularly if the following error message appears in the.log file of idea:

  • Hang for Timed ART trace file

Delay errors appear to have more impact on tracked methods than sampled methods and longer records than shorter files. Trying shorter recordings to see if the error disappears can be useful as a quick solution.

If you encounter problems with the Profiler over timeout, please file a report that includes your device(s) make / model and any related entries from idea.log and logcat.

  • Errors with Git version control in IDE

For Android Studio 4.1 Canary 1 operations involving Git version control authentication are broken in IDE.

Upgrade to Android Studio 4.1 Canary 2 to address the problem.

In this post, we’ll highlight what’s new for System Trace in Android Studio, one of the infrequently used but effective setups for CPU recording. Device Trace records application operations (e.g. CPU core scheduling) and Android system processes (e.g. SurfaceFlinger) as opposed to the Java Process or C / C++ task traces. Additionally, by calling the Trace API in your app you can trigger your code with custom events. This way, it will collect your custom events along with machine events. When you examine performance problems such as UI jankiness or high power consumption, all of this data combined can come in handy.

Android Studio 4.2

New removable environment for modules with dynamic feature

Android Gradle plugin 4.2 uses bundle tool 1.0.0, which implements a dynamic feature module behavior change for apps: any dynamic feature module defined as dist: install-time that is not specifically marked as dist: but removable will be non-removable by default. This new environment optimizes the integration of install-time modules with the base module and theoretically increases the performance of apps for certain applications.

See the documentation for the dist: removable tag in the Dynamic function module manifest for more detail on this new configuration.

Android update to gradle 4.2

In Android Gradle plugin 4.2 a new JVM tool compiler is available now. This tool replaces portions of the AAPT2 resource compiler and, particularly on Windows machines, can potentially boost build performance.

Enable it in the gradle.properties file of your project to try out the JVM tool compiler.

Android.enableCompilerJvmResource = true

Signing into v3 and v4 now accepted

Android Gradle Plugin 4.2 also supports the signing formats APK v3 and v4. Add the following properties to your build.gradle or build.gradle.kts module-level file to allow one or both of these formats within your build.

/ Make.gradle.kts

Ios (android)

SigningThe Configures

Setup

Enable(true)V3Signing

Enable(true)V4Signing

}

}

}

Signing APK v4 allows you to quickly deploy large APKs using the installation ADB Incremental APK in Android 11. The new flag is responsible for the signing phase of the APK during the deployment process.

Support Compose Jetpack

Jetpack Compose toolkit offers a functional approach to designing the UI of your application. The toolkit also includes all the advantages of Kotlin, such as helping you write succinct and idiomatic code which is completely interoperable with Java.

You will use the new edition of Android Studio 4.2 for the best experience working with Jetpack Compose. That’s because you will benefit from smart editor features including New Project templates and the ability to preview your Compose UI instantly while using Android Studio to build your app with Jetpack Compose.

Current Jetpack Support for tooling compose in 4.2

Android Studio also provides additional support for applications that use Jetpack Compose for previewing and checking.

Review System

For @Preview methods the following parameters are available now.

  • Show Background:

Move your preview to and from the context.

  • Background Color:

Set a color used only on the preview board.

  • Ui Mode:

This new parameter will take any of the constants of the Configuration. UI * and allows you to change the preview behavior to, for example, set it to Night Mode to see how the theme reacts.

You can communicate with components of your UI in this mode, click on them, and see how the state changes. It’s a fast way to get feedback on how your UI responds and the animations are previewed. Only click on the interactive icon to activate it and the preview will switch mode.

Apply to computer

To deploy a snippet of your UI to a computer, use this feature. This will help check specific sections of the code within the computer without starting the full program.

Click the deploy to the system icon next to the @Preview annotation or at the top of the preview and Android Studio will deploy the @Preview to the system or emulator connected to you.

View Rest Data sources

The new API for data sources lets you create previews from your results. If you have an existing data set, or a set of themes, this API will allow you to inject it into the @Preview method as a parameter.

class HelloWorldProvider :
CollectionPreviewParameterProvider<String>(

@Preview
@Composable
fun HelloWorldPreview(
@PreviewParameter(HelloWorldProvider::class) text: String
) {
MaterialTheme {
Text(text = text)
}
}

Better Monitoring of instruments

Beginning with Android Studio 4.2 Canary 1, instrumentation testing can now be performed in parallel across several devices and examined using a panel of expert instrumentation test results. With this panel you will assess if tests fail due to the level of the API or hardware properties.

Panel Test Instrumentation

One of the best ways to ensure that all users have a great experience when using your app is to check the app across a wide variety of API levels and form factors.

You can exploit this feature.

  • Select Modify Device Set in the dropdown menu of the target system (at the top of the IDE centre).

The new panel of test results allows you to filter the test results by level of status, user, and API. Furthermore, each column can be sorted by clicking the header. You can display the logs and configuration information individually for each device by clicking on a single test.

Conclusion

I hope you reach a conclusion about new features in Android Studio 4.2. You can learn more through android online training.

Big Data,ios,android,Spark

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store