The Camera2 API is notoriously hard to use, not very well documented, and official sample code provided by Google is more than 7 years old. Implementing a functional flash procedure is what I have spent the past few weeks on, and the journey has been difficult. This post tries to demystify the usage of Camera2, particularly in the context of modern Kotlin where not as many examples exist. The example app shows a basic implementation of the Camera2 API focusing on taking pictures with flash enabled.