Who is this for?

This is an introductory topic for mobile application developers interested in learning how to build an Android selfie application with Modern MediaPipe Multimodal AI, Kotlin flows, and CameraX, using the Modern Android Development (MAD) architecture design.

What will you learn?

Upon completion of this Learning Path, you will be able to:

  • Architect a modern hands-free selfie Android app with MediaPipe.
  • Leverage lifecycle-aware components within the Model-View-ViewModel (MVVM) architecture.
  • Combine MediaPipe's face landmark detection and gesture recognition for integration in a multimodel selfie solution.
  • Use JetPack CameraX to access camera features.
  • Use Kotlin Flow APIs to handle multiple asynchronous data streams.

Prerequisites

Before starting, you will need the following:

Summary

AI-assisted

This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
You’ll build the core of a hands-free selfie Android app with MediaPipe, Kotlin Flow, CameraX, and MVVM. First, you’ll configure Android Studio, connect a physical device, and handle camera permissions. Then, you’ll add MediaPipe Tasks through a version catalog, structure UI state with ViewModel and Jetpack Lifecycle, and connect asynchronous events with SharedFlow and StateFlow.

Frequently asked questions

AI-assisted

These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
Where do I add MediaPipe versions and dependencies?
Add the version entry in libs.versions.toml. After updating the catalog and syncing, Android Studio should resolve the MediaPipe artifacts so you can import the corresponding classes in your code.
How do I know my device is correctly set up for debugging?
Enable USB debugging on the phone, then confirm the Allow USB debugging dialog by selecting Always allow from this computer and tapping the OK button. If you don’t see the dialog, review the Android Developer guidance for setting up a device for development.
When should I handle camera permissions in this project?
Handle camera permissions immediately after connecting your device and before integrating AI features to avoid runtime blockers when accessing the camera with CameraX later.
How do I verify that ViewModel is preserving UI state?
Populate state through the ViewModel class, then rotate the device or trigger a configuration change. The screen-level state should persist without refetching, indicating the ViewModel is working as intended.
Which Kotlin Flow type should I use for events versus state?
Use SharedFlow for one-time UI events that multiple subscribers might observe. Use StateFlow for observable, current UI state that the View needs to render and react to over time.
Next