BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Google Adds Android Support for Kotlin 1.3 and Optimizes for Foldable Devices

Google Adds Android Support for Kotlin 1.3 and Optimizes for Foldable Devices

Leia em Português

This item in japanese

Bookmarks

Google has presented a series of updates at the Android Dev Summit, including new features of Kotlin 1.3 supported on Android, support for foldable phones, in-app Updates API, improvements on Android Studio, and more.

Kotlin

Kotlin 1.3 brings a series of new language features, APIs, bug fixes, and performance improvements. These new features will be integrated into the Kotlin-specific APIs, through KTX extensions (KTX optimizes Jetpack and Android platform APIs for Kotlin use) as part of Android Jetpack, including:

  • Inline classes are an experimental feature that allows developers to create a type which is not allocated unless boxed.
  • Unsigned numbers are now part of the Kotlin standard library, including UInt, UByte, and ULong. These new types are built using inline classes.
  • Multiplatform code previously written for Android or the JVM can now also target JavaScript or native. This unlocks the possibility of reusing parts of the codebase on even more platforms.
  • Coroutines support is now stable. Coroutines provide a powerful paradigm to design asynchronous, non-blocking programs.

Android Studio

Android Studio 3.3 beta 3 brings a series of features, improvements, and bug fixes. Profiler memory allocation now enables developers to choose a mode for live memory allocation tracking:

  • Full: captures all object memory allocations.
  • Sampled: captures a periodic sample of object memory allocations. This is the default behavior and has less impact on app performance while profiling.
  • Off: turns memory allocation off.

CPU profiler now permits developers to inspect how long it takes for a Java app to render each frame on the main UI thread and RenderThread. This data may be useful when investigating bottlenecks that cause UI jank and low framerates.

Android Studio has added a new dialog that enables developers to delete unused directories. When a new major version of Android Studio runs for the first time, it looks for directories containing files that are associated with older versions of Android Studio for which a corresponding installation can't be found. When found, a dialog displays the files, and provides an option to delete them.

Android Studio also included support for building Android App Bundles with full support for Instant Apps. In other words, developers can build and deploy both installed app and Instant App experiences from a single Android Studio project. To start using this, make sure you checked the box in "Configure your project > This project will support instant apps" when creating a new project. The following properties will be added in the manifest:

<manifest ... xmlns:dist="http://schemas.android.com/apk/distribution">
<dist:module dist:instant="true" />
...
</manifest>

Android Studio now includes support for static code analysis using Clang-Tidy for projects that include native code.

R8, a new tool for code shrinking and obfuscation that replaces ProGuard, is now enabled by default.

Foldable phones

Google has announced Android support for foldable phones, named "Foldables". A foldable phone is a new category created by device manufacturers, where a user can fold/unfold a device, as in the image below.

(Image taken from android-developers.googleblog.com)

Google is optimizing Android for a new form factor called screen continuity. In this new form factor, an application can be transitioned from one screen to another automatically. For example, a user starts a video with the folded smaller screen, and later unfolds the device to get a larger screen. As the user unfolds the foldable phone, the app seamlessly transfers to the bigger screen without problem. Samsung has announced the first foldable phone in the Samsung Developer Conference 2018, and plans to offer this in the next year.

In-app Updates API

Google has revealed improvements coming to instant apps, launching an In-app Updates API. With this API, developers will have two options to keep users updating their apps: the first is a full-screen experience for critical updates, forcing users to apply the update immediately. The second is a flexible update, which means the user can keep using the app while the update is downloaded. According to Google, this API is being tested with some Google partners and will be released for all developers as soon as possible.

(Image taken from android-developers.googleblog.com)

Android Jetpack

Android Jetpack brings some updates in the architecture component libraries. The Navigation, designed to simplify the implementation of navigation, will be graduated to beta in November, according to Google.

Another component that will be graduated to beta, according to Google, is the WorkManager, a library that provides a solution for constraint-based background jobs replacing the need to use things like jobs or SyncAdapters, providing a simplified, modern API, that intends to make it easy to specify asynchronous tasks, to work on devices with or without Google Play Services.

Slices are UI templates that can display rich, dynamic, and interactive content from your app from within the Google Search app and in other places like Google Assistant. It has been moved to public Search experiments.

More information can be found on android-developers.googleblog.com. Google also has provided a set of recommendations for users who want to get their apps ready for foldable phones.

If you have Android Studio set up to receive updates on the Beta channel, you can get the update by choosing Help > Check for Updates (Android Studio > Check for Updates on Mac). Otherwise, you can download it here.

Rate this Article

Adoption
Style

BT