Use the device's flash unit on Android SDK (Kotlin/Java)
Stay organized with collections
Save and categorize content based on your preferences.
Enabling the device's flash unit during an AR session can help improve
visibility.
Check that the current camera configuration supports flash
Not all camera configurations support enabling a flash unit.
Before enabling the flash or offering users the option to enable the flash,
ensure that the flash unit is available for the active camera
configuration:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-12 UTC."],[[["Enabling the device's flash during an AR session can enhance visibility in low-light environments."],["Before enabling the flash, verify if the active camera configuration supports it using `CameraCharacteristics.FLASH_INFO_AVAILABLE`."],["Use `Config.FlashMode.TORCH` to enable the flash and `Config.FlashMode.OFF` to disable it within the AR session configuration."],["Attempting to enable the flash on an unsupported camera configuration will have no adverse effect."]]],["To use the device's flash in an AR session, first verify if the current camera configuration supports it using `CameraCharacteristics.FLASH_INFO_AVAILABLE`. If available, enable the flash by setting the AR session's configuration to `Config.FlashMode.TORCH`. This is done through a camera manager service. If not available setting it will have no effect. To disable the flash, set the session's configuration to `Config.FlashMode.OFF`. Code examples in both Java and Kotlin are provided.\n"]]