BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Android 15 Beta Brings Loudness Control, Improvements for Satellite Connectivity, and More

Android 15 Beta Brings Loudness Control, Improvements for Satellite Connectivity, and More

Android 15 has introduced support for the CTA-2075 loudness standard. The loudness standard is designed to ensure consistent audio loudness levels across different types of content and devices, improving the user experience by reducing the need to constantly adjust the volume. The audio loudness and dynamic range compression levels are automatically adjusted based on info on the output devices along with metadata available in ACC audio content.

It is important to notice that the loudness metadata must be available in the AAC content to enable this feature. The LoudnessCodecController.create(mSessionId); is responsible for automatically applying audio updates:


// media contains metadata of type MPEG_4 OR MPEG_D
val mediaCodec = ...
val audioTrack = AudioTrack.Builder()
                                .setSessionId(sessionId)
                                .build()
...
// create new loudness controller that applies the parameters to the MediaCodec
try {
   val lcController = LoudnessCodecController.create(mSessionId)
   // starts applying audio updates for each added MediaCodec

Screen record detection allows apps to detect that they are being recorded. It is performed via a callback whenever the app transitions between visible or invisible within a screen recording. This feature is important in scenarios where the app is performing a sensitive operation, allowing developers to notify the user that they are being recorded. The callbacks can be registered as follows:


val mCallback = Consumer { state ->
  if (state == SCREEN_RECORDING_STATE_VISIBLE) {
    // we're being recorded
  } else {
    // we’re not being recorded
  }
}

override fun onStart() {
   super.onStart()
   val initialState =
      windowManager.addScreenRecordingCallback(mainExecutor, mCallback)
   mCallback.accept(initialState)
}

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

Satellite connectivity support has been expanded in this version. This includes the addition of UI elements aiming to ensure a consistent user experience, as well as support for SMS, MMS apps, and preloaded RCS apps to use satellite connectivity for sending and receiving messages. To detect when a device is connected to a satellite, developers can use ServiceState.isUsingNonTerrestrialNetwork().

Apps will be edge-to-edge by default in Android 15+ after they target SDK 35. This removes the need to call Window.setDecorFitsSystemWindows(false) or enableEdgeToEdge() to show content behind the system bars. However, Google recommends to call enableEdgeToEdge() on earlier Android versions. There are some Material 3 composables available to assist developers to handle insets and make the app edge-to-edge.

(image taken from android developer blog)

In this latest version of the OS, many Android core libraries have been updated to keep Android aligned with OpenJDK 17 LTS. These include improvements for NIO buffers, Streams, and additional Math and StrictMath methods. The package java.util update includes SequencedCollection, SequencedMap and SequencedSet. Furthermore, security updates like X500PrivateCredential and security key updates have been implemented. According to Google over a billion devices running Android 12 (API level 31) and higher through Google Play System updates are updated with these APIs.

Android 15 also introduces new SQLite APIs that provide access to advanced features in the SQLite engine, aiming to address performance issues in apps. It is recommended that developers follow the best practices for SQLite performance, particularly when dealing with large databases or running latency-sensitive queries. Following some recommendations for specific issues:

  • Read-only deferred transactions: for read-only transactions, use beginTransactionReadOnly() and beginTransactionWithListenerReadOnly(SQLiteTransactionListener) to issue read-only DEFERRED.
  • Row counts and IDs: to return the number or rows inserted/update/deleted by the most recent SQL statement use getLastChangedRowCount(), while getTotalChangedRowCount() returns the count on the current connection, and getLastInsertRowId() returns the rowid of the last row to be inserted on the current connection.
  • Raw statements: issue a raw SQlite statement, bypassing convenience wrappers and any additional processing overhead that they may incur.

Included in Android 15 Developer Preview 2, PdfRenderer APIs now enables apps to incorporate advanced features such as rendering password protected files, annotations, form editing, searching and selection with copy. Furthermore, the PdfRenderer has been moved to a module that can be updated via Google Play system updates independent of the platform release.

The Android 15 Beta is available to users that have any supported Pixel device, or via system images with the Android Emulator in Android Studio.

For a complete list of the new features and APIs, take a look at the Android 15 Beta features overview.

About the Author

Rate this Article

Adoption
Style

BT