- Tencent Video link: v.qq.com/x/page/m089…
- Bilibili video link: www.bilibili.com/video/av569…
People’s lives are being recorded and shared in a more timely and colorful way, and smartphone cameras can even help users delve into the world before them, providing real-time translation and other assistance. But what you may not know is that more than 70% of cameras use apps created by individual developers, rather than the system’s native camera features. Users need a more personalized, scalable experience, but that also means a lot of effort to test and polish camera features.
At last year’s GDD (Google Developer Day) in China, we talked to a lot of camera app developers about their testing workload and learned that in order to ensure compatibility, responsiveness, and other details of the experience, they even test manually on hundreds of different devices.
CameraX is designed to address this pain point. It is a camera development support library within Jetpack designed to help developers easily create high-quality camera experiences. Its core functions include:
- Lifecycle aware API is easy to use and reduces the use of template code compared to camera2
- Compatible with Android L (API 21), ensuring that the same code runs on 90% of the devices on the market
- On supported devices, developers can use the same features as the native camera app (including portrait, Night mode, HDR, and beauty filters) in an extension form
But it wasn’t easy to ensure such a wide range of devices, so we built an automated CameraX test lab to test camera functionality in depth. In addition, the Mobile Harness is used to test the universal camera function.
- In-depth testing included 50 OEM equipment covering approximately 200 million daily live equipment
- Test over 500 devices, including NBU/Android Go devices, on Mobile Harness. (NBU = Next Billion Users)
The Camera360 development team that was introduced earlier
We keep an eye on the latest technology and API developments, and CameraX was our bridge to capture camera apis, reducing our core camera code by two-thirds and greatly improving the efficiency of new product development. — Tao Li, Technical director of Chengdu Pinguo Technology
We saw that Camera360 ran smoothly on a device running Android 6.0 Marshmallow and used the three core CameraX scenarios: live preview, image analysis and photography. During development, Camera360 was also able to reduce the amount of testing on the device and the number of lines of code was significantly reduced (about 70%) compared to Camera2, which resulted in a smaller APK size for Camera360. — Vinit Modi, Product Manager, Android Camera Platform Team
At this year’s I/O Developer conference, Vinit Modi also gave an entire presentation detailing CameraX, and you can watch the full video:
Android Jetpack: Learn about the camera support library CameraX
If the video is too long, we’ve compiled a summary of CameraX’s history:
- CameraX builds on pain points and requirements provided by more than 20 development teams. Several of Android’s top developers (including Snapchat, Twitter, and TikTok) have said they would use the library in their apps since its inception.
- Compared to iOS, CameraX has several “firsts” :
- First implementation of static HDR photo shooting (developers need to generate their own HDR images on iOS)
- The first one implements still photo shooting in night mode
- CameraX is also used for camera functions in Google Go, which is developed for entry-level devices, to recognize text and other content in the camera. In addition to the speed of development and compatibility, the APK is also very small in size (the camera part is less than 30KB).
- Samsung also announced in March that it was dropping support for its proprietary camera SDK in favor of CameraX. (Even contributed code to AOSP!)
- There were four demos of CameraX at THE I/O conference, and developers who got a taste of it early on were very positive.
Click here toCheck out more developer success stories