Performance, AVF, KSP2, AICore, ML Kit, Android Studio, Gemini, and more!

Performance, AVF, KSP2, AICore, ML Kit, Android Studio, Gemini, and more!

Here’s the most recent (and final one for this year) issue of Now in Android, your go-to source for anything noteworthy and new in the field of Android development.

Feel free to watch or listen to the majority of this post instead of reading it, as it is accessible as a podcast or video. (Or, to help you remember, do all three! There will be no test.)

An All-New Basis for AI on Android

Our most powerful AI model to date, Gemini, was unveiled on December 6th!
Three distinct sizes have been optimized for it: Ultra, Pro, and Nano. Our most effective model, Gemini Nano, is designed for on-device tasks and runs directly on mobile hardware, enabling offline, privacy-sensitive inference.

We recently announced that you will soon be able to utilize Android AICore with Gemini Nano by using the Google AI Edge SDK. The Pixel 8 Pro is the first gadget to receive it; further devices and silicon partners will be revealed in the upcoming months.

Currently, even when the phone’s network connection is down, AICore is used to summarize content in the Recorder app.

Please up for our Early Access Program if you’re interested in using Gemini Nano and the Google AI Edge SDK to create apps.

Subject Segmentation API for ML Kit 

You can quickly and simply separate several subjects from the backdrop of a photo with the new ML Kit Subject Segmentation API, which is currently in beta. The API creates an output bitmap or mask for the foreground from an input image. Additionally, it offers a mask and bitmap for every subject that was found.

With just a few lines of code, it allows for interesting use cases like background swapping and adding distinctive effects to humans, pets, or objects.

Visit the ML Kit documentation to get started.

Hedgehog on Android Studio is stable 

With numerous updates, including the addition of a new Power Profiler and enhancements to Android essentials in App Quality Insights, Android Studio Hedgehog is now stable.

Apps may now be upgraded to target Android 14 more easily with the help of the Android SDK Upgrade Assistant.

Lastly, there are other tools to speed up development with Jetpack Compose, such as the Gallery Mode in Preview, the Debugger’s Compose State data, and Compose Multipreview templates.

Blog for Android Developers 

Check out our latest blog posts! We have a few up!

Learn more about the Android Virtualization Framework (AVF), a fundamental Android Primitive that will be accessible on a few forthcoming Android 14 devices, and the new capabilities it will provide both privileged app developers and platform developers.

Also, read more on the launch of KSP2 Preview, which introduces support for the new Kotlin compiler (code-named K2) and a new standalone source generator that provides more flexibility and features than the current Kotlin compiler plugin.

Finally, learn more about how NordVPN boosted the speed of its login user flow by 60% using Baseline Profiles.

Videos 

Watch Tomáš’s video on “Improving Jetpack Compose Performance” to see how he approaches performance via debugging, measurement, and strategic optimization.

The simplest optimization method is to update Jetpack Compose so that it can take advantage of the internal performance enhancements we apply. Enabling R8 and creating a baseline profile is another, which can greatly improve code execution. Thirdly, consider delaying the compose phase to avoid needless recomposition if you occasionally have quick state changes. Watch the video for a more thorough breakdown.

AndroidX Updates 

With Android Jetpack, we just released a number of fascinating new features:

To enable components to callbacks for onUserLeaveHint events, Activity 1.9-Alpha ComponentActivity now implements OnUserLeaveHintProvider.
We introduced a new WebSettingsCompat API in Webkit 1.10-Alpha to regulate the behavior of the experimental Android WebView Media Integrity API.
All of the AndroidX release notes are available here.

Alright, so…
With Gemini, AICore, ML Kit, Android Studio, AVF, KSP2, Performance, and more, that’s all we have for this week!

Happy holidays, and stay tuned for our next update from the world of Android developers next year!