Getting Frames of Live camera footage as Bitmaps in Android using Camera2 API Kotlin

Hamza Asif
8 min readApr 13, 2021
Photo by Angela Compagnone on Unsplash

Note: we will be using Kotlin in this story for Java click here.You can also watch video lecture of story here on youtube

There are always some things that we think are difficult to understand but in reality, we are not looking at those things from the right angle.

One such thing for Android developers is to display live camera footage inside their applications and getting frames of live footage one by one and using them for particular purposes like passing them to machine learning models and stuff like that.

So here I will teach you to add that live camera footage in your application in a really simple way.

Note: Learn the use of machine learning and computer vision in Android, Flutter & React Native with our Mobile Machine Learning courses. You can avail discount on the following Android machine-learning courses

  1. Train Object Detection Models for Android — The 2024 Guide
  2. Android & Google Gemini — Build Smart Android Kotlin Apps
  3. Face Recognition and Detection in Android- The 2024 Guide
  4. Android ML — Train Tensorflow Lite Models for

--

--