MobileNews

Android 13’s new features for developers aren’t all exclusive

Android 13 has some fantastic new features for developers, including an update to the core Java libraries, some of which will also be coming to older versions of Android.

For the last few years, Google has been actively working on Project Mainline, an effort to separate core components of Android from the yearly update cycle. Instead, these have been separated out into modules which can be delivered via the Google Play Store, breathing new life into older versions of Android.

Meanwhile, Android app developers have long been able to take advantage of the Jetpack suite of libraries. In addition to offering simple convenience, Google will, where possible, backport modern Android APIs to older versions so that developers can focus on making their apps better.

Non-exclusive Android 13 features

These possibilities for features to be available across new and old devices is becoming more relevant than before for developers with the announcement of Android 13, which will simply serve as the debut for some upcoming features.

The one change likely to affect the most mobile developers is that with Android 13, Google is bringing Android’s implementation of Java more in line with OpenJDK 11. This comes with a suite of new methods for working with strings, arrays, and optionals. Java 11 will also allow for less boilerplate in code, as developers can type “var” when declaring a variable and let the compiler infer the type automatically.

Google has laid out some of the details of what to expect from using the enhancements of OpenJDK 11 in Android. Excitingly, these changes will also become available to Android 12 devices in the near future, thanks to a major update to the Android Runtime (ART) module, set to arrive through a Play Store System Update.

Similarly, Google has launched a new photo picker for use by apps on Android 13, which offers a clean gallery-like approach to selecting one or more images to share/upload/etc. Adding it to your existing Android app looks fairly straightforward, according to the documentation Google has provided. Our Dylan Roussel was able to demonstrate the picker in action in a demo app in a matter of minutes.

Through an update to the MediaProvider module, arriving as a Play System Update, this new picker UI will also become available on Android 11 and 12 devices. It’s not clear at this point how the modern-styled photo picker will look on Android 11 devices, considering Material You first arrived with Android 12.

Android 13 also promises the potential for the end user to decide to use an app in a language other than their device’s current default. To allow for this, Google has provided a way for Android apps to easily change translations while the app is still running. Importantly, Google is making this translation-changing capability available on older Android versions through an upcoming Jetpack library.

Android 13 exclusive additions

That said, Google did still have some Android 13-specific changes to share with the first Developer Preview, with no likelihood of them coming to older versions.

As part of the ongoing effort to fully support foldable devices, which can cause your app to change size at a moment’s notice, the ability to automatically wrap and hyphenate lines of text can be critical to a dynamic layout. However, hyphenation (the automatic placement of hyphens) on Android is a bit of a pain point, running a bit slowly to ensure accuracy.

With Android 13, Google is launching two new hyphenation styles for developers to choose from, offering “fast” versions of the “normal” and “full” styles. To boost performance by as much as 200%, these “fast” styles ignore some of the usual linguistic rules for hyphen placement and kerning.

Android has long offered the ability for apps to create their own tile in Quick Settings, allowing for either easy access to part of the app or to toggle a particular feature. However, it’s always required some effort on the end user’s part to put that custom tile in place, mostly in needing to remember how to customize Quick Settings and scroll way down to find the right tile.

In Android 13, your app can now politely offer to add its custom Quick Settings tile to the user’s lineup. With a single tap, they can accept or decline the offer, adding the tile automatically if desired.

Google has also laid out some instructions on how to offer a Material You-styled “Themed icon” for your app. Once you’ve got your graphic finalized, it’s an easy, single-line addition to your AndroidManifest file to offer the icon.

For developers whose apps connect via Wi-Fi to other devices — such as connecting to a temporary network when configuring an IoT device — Google is loosening up some restrictions in Android 13. Specifically, there’s a new permission for this, NEARBY_WIFI_DEVICES, which can be declared as not being used for location data. This allows developers to make the connections they need while letting users not be confused about the need to share their “location” with an app.

These are just the biggest changes for Android developers that Google is talking about right now. Under the hood, there are quite a few tweaks and additions in Android 13, and you can find the full list in the official Android API documentation.

Dylan Roussel contributed to this article

More on Android 13:


Check out the latest Samsung phones at great prices from Gizmofashion – our recommended retail partner.


Author: Kyle Bradshaw
Source: 9TO5Google

Related posts
AI & RoboticsNews

H2O.ai improves AI agent accuracy with predictive models

AI & RoboticsNews

Microsoft’s AI agents: 4 insights that could reshape the enterprise landscape

AI & RoboticsNews

Nvidia accelerates Google quantum AI design with quantum physics simulation

DefenseNews

Marine Corps F-35C notches first overseas combat strike

Sign up for our Newsletter and
stay informed!