Close ad

Many people today buy smartphones to take advantage of their great camera capabilities. For example Galaxy S22Ultra it has seen huge demand precisely because of its exceptional camera performance. And cameras will continue to be one of the main reasons consumers buy a phone.

In order to use the capabilities of the camera in their applications, developers are adopting androidCamera Framework interface. The first use case of this framework is the camera preview implementation. However, as foldable devices become more popular, the camera's preview screen can stretch, flip, or rotate incorrectly. When used in a multi-window environment, the application often crashes.

To solve all this, Google has now introduced a new feature called CameraViewfinder that will take care of all these details and give developers an efficient camera experience. As Google states in the blog contribution: "CameraViewfinder is a new addition to the Jetpack library that allows you to quickly implement camera views with minimal effort."

CameraViewfinder uses either a TextureView or a SurfaceView, allowing the camera to adjust according to the transformations. Transformations include correct aspect ratio, scale and rotation. The feature is now ready to be used across flexible phones, configuration changes and multi-window mode. Google notes that it has tested it on a large number of folding devices.

For example, you can buy Samsung phones here

Today's most read

.