Android Studio Dolphin extends integration of Jetpack Compose, Wear OS and Test Automation

The latest version of Android Studiodubbed Dolphin, improves Jetpack Compose screen previews, expands Wear OS support, and introduces Gradle Managed Virtual Devices to simplify test automation.

Overview of the Jetpack Compose screen gets three new features: multipreview annotations, an animation inspector, and recomposition count. Multipreview annotations aim to reduce boilerplate code with preview definitions that specify devices to generate previews for, fonts and themes to use, and more. The annotations can then be reused to avoid copying and pasting the definitions themselves, as developers had to do until now. The following snippet shows how you can set a FontScalePreviews annotation and use it in a composable preview:

@Preview(
    name = "small font",
    group = "font scales",
    fontScale = 0.5f
)
@Preview(
    name = "large font",
    group = "font scales",
    fontScale = 1.5f
)
annotation class FontScalePreviews

...

@FontScalePreviews
@Composable
fun HelloWorldPreview() {
    Text("Hello World")
}

The animation preview inspector helps preview and fine-tune animations by letting you freeze an animation or run it frame by frame.

The composition recomposition count, available in the Layout Inspector, indicates how often a view is recomposed, that is, rendered. This can help identify cases where redialing too often can negatively impact performance.

Virtual devices managed by Gradle is a new feature that aims to facilitate the management and configuration of emulators used for testing. Instead of having to manually perform all the steps required to provision an emulator for testing, you can now describe the virtual devices you want in your build.gradle case. The tool will then download the corresponding SDK, if necessary, provision and configure the emulator, and run your tests. Here’s how you can use this feature indoors gradle.build:

android {
    managedDevices {
        devices {
            pixel2api30 (com.android.build.api.dsl.ManagedVirtualDevice) {
                device = "Pixel 2"
                apiLevel = 30
                systemImageSource = "google-atd"
            }
            ...
        }
    }
}

As mentioned, Wear OS support is also improved in Android Studio Dolphin. This includes a new Wear OS emulator pairing wizard that helps manage and pair multiple Wear OS devices; Improved emulation toolbar that better aligns with physical devices and emulates palm gestures and tilt; and better support for launching a Wear OS app in the exact state you expect, directly from the IDE.

Finally, Android Studio Dolphin is updating its compiler toolchain to IntelliJ 2021.3, which includes a number of improvements including better Kotlin debugging, improved suggestions, and remote coding support.

Android Studio Dolphin can be downloaded from Google Android website or installed directly from a previous version.

Comments are closed.