Google Launches Android 15 Beta, Feature Upgrades Draw Attention

2024-05-14 10:42:00

Android 15 introduces support for the CTA-2075 volume standard. This new feature focuses on enhancing the user experience by ensuring consistency in audio loudness levels when switching between different types of content or across various devices. As a result, users do not need to frequently adjust the volume while watching videos or listening to music.

Android 15 introduces support for the CTA-2075 volume standard. This new feature focuses on enhancing the user experience by ensuring consistency in audio loudness levels when switching between different types of content or across various devices. As a result, users do not need to frequently adjust the volume while watching videos or listening to music. This standard bridges the gap between user needs and technology, intelligently adjusting audio loudness and dynamic range compression levels by collecting metadata from output devices and AAC audio content.

It should be noted that this smart adjustment feature will only work when the necessary loudness metadata is embedded within the AAC audio content. Developers can create a new loudness controller with the following code snippet to apply the automatically adjusted parameters to audio playback:


// Create loudness controller
val lcController = LoudnessCodecController.create(mSessionId)

// The following code is for configuring the media codec
val mediaCodec = ...
val audioTrack = AudioTrack.Builder()
.setSessionId(sessionId)
.build()
...

Further enhancements include screen recording detection functionality. This allows applications to be aware of when they are being recorded, which is great for alerting users when performing sensitive operations. The method for registering the callback is shown below, so as to handle the screen recording status when the application starts and stops:


// Register screen recording callback
override fun onStart() {
super.onStart()
val initialState = windowManager.addScreenRecordingCallback(mainExecutor, mCallback)
mCallback.accept(initialState)
}

override fun onStop() {
super.onStop()
windowManager.removeScreenRecordingCallback(mCallback)
}

This version also expanded support for satellite connections, which includes new UI elements designed to offer users a consistent and smooth experience. Additionally, satellite connectivity now allows for SMS, MMS, and pre-installed RCS apps to send and receive messages through satellite links, further broadening the boundaries of communication.

Developers who need to detect when mobile devices connect to satellite networks can use the ServiceState.isUsingNonTerrestrialNetwork() method. For apps using Android 15 or higher and targeting SDK 35 as the platform, the default will enter edge-to-edge mode, eliminating the need to use Window.setDecorFitsSystemWindows(false) or enableEdgeToEdge() to accomplish this feature. However, for older versions of Android devices, Google recommends developers call enableEdgeToEdge() to adapt to different versions.
Furthermore, for the increasingly popular Material 3 design, there is now composable component support to help developers handle inset content, enabling applications to present a boundary-less display.
To ensure that Android grows in sync with OpenJDK 17 LTS, the new version of the operating system has made multiple updates to core libraries, including improvements to NIO buffers and Streams, and new Math and StrictMath methods. Updates have also touched on the java.util package, with the addition of SequencedCollection, SequencedMap, and SequencedSet. In terms of security, updates have been made, such as X500PrivateCredential and updates to security keys. According to Google statistics, over 1 billion devices running Android 12 (API level 31) and above have updated these APIs through Google Play system updates.
Android 15 also brings new SQLite APIs, allowing developers to leverage the advanced features of the SQLite engine to optimize application performance issues. For database performance, it is recommended to follow the SQLite performance best practices, especially when dealing with large datasets or performing queries sensitive to response time. Some specific performance suggestions include:
  • For transactions that only need to read data, it is recommended to use beginTransactionReadOnly() and beginTransactionWithListenerReadOnly(SQLiteTransactionListener) to initiate a read-only DEFERRED transaction.
  • To easily get the number of rows affected by the latest SQL statement, you can use getLastChangedRowCount(), while getTotalChangedRowCount() provides the total number of rows modified in the current connection, and getLastInsertRowId() returns the rowid of the most recent insert operation.

Developers are advised to use raw SQLite statements to avoid potential performance losses that may come with third-party library wrappers. In the newly released Android 15 Developer Preview 2, the PdfRenderer API has added a series of advanced features that enable apps to render password-protected PDF files, annotate, edit forms, and implement search and text copy for selection.

What’s more noteworthy is that PdfRenderer has now become a module that can be iteratively updated through Google Play system updates, meaning its updating cycle can be independent of the overall updates to the Android platform. For developers and testers, they can experience Android 15 Beta on any supported Pixel device, or through the system images of the Android Emulator built into Android Studio.

To obtain exhaustive information on all the new features and APIs of Android 15 Beta, refer to the related feature summary documentation.