DEAL Galaxy S24 FE, Galaxy Watch 7. Subscribe today and be the first to learn about One 7 beta!

SamMobile has affiliate and sponsored partnerships. If you buy something through one of these links, we may earn a commission.

News For You
News For You
Notifications

Google is encouraging developers to make better-behaving apps for foldables

Phone
By 

Last updated: November 22nd, 2022 at 07:14 UTC+01:00

Most smartphone buyers buy a phone to take advantage of these phones' great camera capabilities. For example, the Galaxy S22 Ultra saw a huge demand among smartphone buyers because of its exceptional camera performance. And cameras are going to be one of the top reasons for a consumer to purchase a phone.

App developers, in order to use the camera capabilities in their apps, adopt Android's Camera Framework. The first use case of the framework is to implement the camera preview to be displayed in the app. But as ambitious foldable devices like Samsung's Galaxy Z Fold 4 are becoming increasingly popular, the camera preview screen may become stretched, upside-down, or incorrectly rotated. Often these make the app crash if used in a multi-window environment.

To fix all this, Google is setting some new guidelines with the new CameraViewfinder that will take care of all those details and provide a streamlined camera experience. As noted in the official blog, “CameraViewfinder is a new artifact from the Jetpack library that allows you to quickly implement camera previews with minimal effort.

This CameraViewfinder employs either a TextureView or a SurfaceView, allowing the camera feed to adjust in accordance with the transformations. The transformations include the correct aspect ratio, scale, and rotation. Moreover, it is fully compatible with the Camera2 codebase.

For a complete step-by-step process to use the CameraViewfinder, you can visit here. The CameraViewfinder function is now ready to use across foldable phones, configuration changes, rotations, and multi-window modes. In fact, as noted in the blog, it has been tried and tested on many foldable devices.

Phone Google
Galaxy AI summarized

Scroll for more related content
News For You

You might also like

Quick Share could come to iPhones and Macs

Quick Share could come to iPhones and Macs

After Google merged Nearby Share into Quick Share last year, Quick Share became the AirDrop equivalent for Android and ChromeOS ecosystems. However, file sharing between Android and iPhone users still isn’t straightforward, and that could change soon if Quick Share launches on iOS and macOS. An important bug fix hints at possible launch of Quick Share for iPhones […]

  • By Abid Iqbal Shaik
  • 7 hours ago
Early Android 16 release could bring One UI 8.0 sooner

Early Android 16 release could bring One UI 8.0 sooner

Usually, Google releases a stable version of a new version of Android in the third or fourth quarter of a year. Take the last three versions of Android for example. The company released Android 13 in August 2022, Android 14 in October 2023, and Android 15 in October 2024. Well, Google will release the next […]

  • By Abid Iqbal Shaik
  • 14 hours ago
Galaxy Z Flip 7, Fold 7 could launch with One UI 8 onboard

Galaxy Z Flip 7, Fold 7 could launch with One UI 8 onboard

There is no denying that Samsung has been very late this year. It is November, and Samsung still hasn't released the first beta version of Android 15 (One UI 7.0). However, One UI 8.0 could be released much earlier next year, as Google has confirmed that Android 16 will be released early in 2025. Android […]

  • By Asif Iqbal Shaik
  • 23 hours ago
Google Messages gets dual-SIM RCS on Galaxy phones

Google Messages gets dual-SIM RCS on Galaxy phones

RCS, the successor to SMS and MMS, received a huge boost when Apple announced support for it with iOS 18. Still, it was missing out on a few features, like the ability to activate RCS on both SIM cards on supported dual-SIM phones. That feature is rolling out now via Google Messages. Google Messages brings […]

  • By Abid Iqbal Shaik
  • 2 days ago
Google Play Store is getting ready for Samsung’s XR headset

Google Play Store is getting ready for Samsung’s XR headset

It has been close to a year since Samsung first teased its upcoming extended reality (XR) headset on the stage. Since then, Google, Qualcomm, and Samsung have reiterated their commitment towards and plans for XR headsets. Now, it finally appears that Google is preparing the Play Store for Samsung's XR headset. Google Play Store will […]

  • By Abid Iqbal Shaik
  • 2 days ago
Gboard to get a more uniform-looking Dynamic Color theme

Gboard to get a more uniform-looking Dynamic Color theme

Google’s keyboard app for Android, Gboard, has been offering support for the Dynamic Color theme for quite some time now. It automatically selects a color palette for the keyboard that matches the system theme or wallpaper. That offers a uniform look across the system. Well, except for a few elements. The story continues after the […]

  • By Abid Iqbal Shaik
  • 2 days ago