|
Google giveth, and Google taketh away. Every new Android release introduces a lot of new APIs that either improve the functionality of existing apps or open up new categories of apps. [br][br]On the other hand, Google also removes access to or restricts the capabilities of existing APIs to improve the security of the Android platform. [br][br]The Android Q release is no different, and we’ve already talked a lot about its changes to shared storage, clipboard access, notifications, and other APIs. [br][br]At this year’s Google I/O developer conference, Google announced new APIs in Android Q that are especially interesting for users and mobile game developers: the AudioPlaybackCapture and Thermal APIs.[br][br]Mobile gaming is a huge industry with no signs of slowing down anytime soon, especially in markets like the U.S., China, and India. With more people spending time on their smartphones for gaming and social media, it’s no surprise that people want to share their gaming experiences online.[br][br]Android has supported taking screenshots since basically the very beginning, but capturing videos of the screen has only been supported since Android 5.0 Lollipop with the introduction of the MediaProjection API. Sadly, this API does not allow third-party apps to record the internal audio output in other apps, forcing third-party screen recorders to record external audio output from the device’s microphone(s). [br][br]Fortunately, Google is finally introducing a way in Android Q for third-party apps to record the audio from other apps.[br][br]The AudioPlaybackCapture API is described by Google as the analog of screen capture, but for audio recording. Although the only app so far to use the API is Google’s LiveCaption, an accessibility tool that adds captions to any video being played on the device, the API’s documentation states that its primary purpose is to allow streaming apps to capture the audio being played by games. Think mobile gamers streaming their sessions onto services like Twitch or YouTube. The API is designed to not affect the audio latency of the app whose audio is being captured, making it perfect for gameplay recording so the audio and video don’t get desynced.[br][br]Unlike in the early days of Android, Google’s approach to new APIs is more cautious. AudioPlaybackCapture can only be used if both the app whose audio is being captured and the app doing the capturing meet specific requirements. [br][br]Thermal throttling is almost entirely managed by the system with no input from, or even notification to, the apps that are most affected by throttling. If the device’s resources are too strained, most devices will throttle the CPU and GPU speeds to the detriment of your game’s performance. There’s nothing you, as a game developer, can really do about it except warn the user before they change any settings about the potential impact their changes may have on performance.[br][br]With the new Thermal API in Android Q, however, apps can receive callbacks for different stages of performance throttling – giving developers the chance to help reduce the strain on the device by ramping down on activities that require significant CPU, GPU, or modem usage. For example, a game could dynamically reduce the resolution until the device is no longer GPU throttling, or a Maps app could disable enhanced features like Augmented Reality navigation to reduce the load on the CPU[br][br]Source: xda-developers.com |
|