Monzo: CameraX の導入により 9,000 行を超えるコードを削減した結果、登録離脱率が 5 分の 1 に低下
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Monzo はデジタルとモバイルに特化したオンライン銀行で、同名のアプリも提供しています。同社の使命は、すべての人のためにお金を役立てることです。Monzo アプリでは、新規顧客が登録する際、身分証明書(パスポート、運転免許証、ID カードなど)の画像と自撮り動画を撮影して、身分証明書が申請者本人のものであることを示す必要があります。
Eyecon の取り組み
Monzo アプリの初期バージョンでは、camera2 API が使用されていました。一部のデバイスでランダムなクラッシュや異常な動作が発生し、身分証明書と自撮り動画の撮影のステップ以降に進まないユーザーが 25% に達していました。
こうした課題に対処するため、Monzo はカメラアプリの開発を容易にするために設計された Jetpack サポート ライブラリである CameraX を採用し、画像と動画撮影の要件を実装することにしました。CameraController
の takePicture()
メソッドを使用して身分証明書の画像のキャプチャを実装し、自撮り動画については startRecording()
メソッドと stopRecording()
メソッドを使用しました。同社は登録フローの設計の変更にあたって、より柔軟な設計を可能にする、シンプルなカメラ ライブラリを必要としていたのです。
結果
CameraX を導入したことでコードが簡素化され、その結果メンテナンス性が向上して開発も簡素化されました。また、CameraX に移行したことでクラッシュの頻度が大幅に低減し、カメラのフラッシュが突然起動することがなくなりました。これらすべてが、登録フローにおける離脱率の低下につながり、ユーザーからのフィードバックも改善されました。
CameraX を実装してコードを簡素化した結果、6,000 行の UI コードを含め、約 9,000 行のコードを削減できました。これによってコードの保守や開発が簡素化されただけでなく、単体テストにおけるコード カバレッジも向上しました。
重要なのは、登録フローへの影響が大きかったことです。CameraX の導入とフロー設計の簡素化により、身分証明書画像と自撮り動画の撮影における離脱率が 25% から 5% に減少しました。
「CameraX は安定性に優れていたため、当社のデベロッパーは容易に統合を行うことができました。CameraX は当社にとって完璧なライブラリでした。簡単に写真や動画を撮影できる方法だけを求めていたのですが、CameraX はその要件を満たすだけでなく、コードの簡素化とユーザー エクスペリエンスの向上にも役立ちました。」Monzo の Android デベロッパーである Anastasios Morfopoulos 氏は、このように語っています。
始める
CameraX のドキュメントを参照して、より強固でシンプルな画像キャプチャ コードをアプリやゲームに導入する方法についてご確認ください。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[null,null,["最終更新日 2025-07-27 UTC。"],[],[],null,["# Monzo reduced over 9,000 lines of code and improved registration dropout by 5x with CameraX\n\nMonzo is a banking service and app offering digital and mobile-only financial\nservices. Their mission is to make money work for everyone. To sign up new\ncustomers, the Monzo app captures images of an identification document (such as\npassport, driving license, or ID card) and takes a selfie video to prove that\nthe identification documents are for the applicant.\n\nWhat they did\n-------------\n\nEarly versions of the\n[Monzo](https://play.google.com/store/apps/details?id=co.uk.getmondo)\napp used camera2 APIs. Random crashes and odd behaviors on some devices led to\n25% of potential customers not proceeding beyond the identification capture and\nselfie video steps.\n\nTo address these challenges, Monzo turned to CameraX, a Jetpack support library\ndesigned to make camera app development easier, to implement their image and\nvideo capture requirements. Using\n[`CameraController`](/reference/androidx/camera/view/CameraController), Monzo implemented\nthe identification document image capture using the\n[`takePicture()`](/reference/androidx/camera/view/CameraController#takePicture(androidx.camera.core.ImageCapture.OutputFileOptions,%20java.util.concurrent.Executor,%20androidx.camera.core.ImageCapture.OnImageSavedCallback))\nmethod. For the selfie video, they used the\n[`startRecording()`](/reference/androidx/camera/view/CameraController#startRecording(androidx.camera.view.video.OutputFileOptions,%20java.util.concurrent.Executor,%20androidx.camera.view.video.OnVideoSavedCallback))\nand\n[`stopRecording()`](/reference/androidx/camera/view/CameraController#stopRecording())\nmethods. They wanted to make design changes to the sign-up flow and wanted a\nmore straightforward camera library that would give them more design\nflexibility.\n\nResults\n-------\n\nIntroducing CameraX enabled Monzo to simplify their code, making it more\nmaintainable, and has helped simplify development. The move to CameraX has\ngreatly reduced crashes and they are no longer seeing random activations of the\ncamera flash. All of this has contributed to a reduction in the drop-off rate in\nthe sign-up flow and has improved user feedback.\n\nThe simplification in code resulting from implementing CameraX reduced almost\n9,000 lines of code, including 6,000 lines of UI code. In addition to making\nthe code easier to maintain and simplifying development, CameraX also led to\nbetter code coverage in unit tests.\n\nImportantly, the impact on the sign-up flow was significant. With the\nintroduction of CameraX and the simplified flow design changes, the dropout rate\nfrom identification image capture and selfie video recording dropped from 25% to\naround 5%.\n\n\"For us, CameraX was all about stability and having an easy integration\nexperience for our developers. It was the perfect library for us---we just\nwanted a simple way to take pictures and videos. CameraX has given us that, plus\nour code is simpler and the user experience better.\" *Anastasios\nMorfopoulos---Android developer, Monzo*\n\nGet started\n-----------\n\nCheck out the [CameraX documentation](/training/camerax) to learn how to\nintroduce more robust and simplified image capture code to your app or game."]]