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.
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.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.- For transactions that only need to read data, it is recommended to use
beginTransactionReadOnly()
andbeginTransactionWithListenerReadOnly(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()
, whilegetTotalChangedRowCount()
provides the total number of rows modified in the current connection, andgetLastInsertRowId()
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.