Supported on Android and iOS targets

Quick start

The camera picker component provides a native interface for users to capture photos using their device’s camera.
val file = FileKit.openCameraPicker()

Camera type

You can specify the type of media to capture using the type parameter:
  • Photo - Capture a photo (default)
  • Video - Capture a video (coming soon)
val file = FileKit.openCameraPicker(type = FileKitCameraType.Photo)
Video capture support is planned for a future release.

Destination file

You can specify where the captured photo should be saved using the destinationFile parameter. By default, the photo is saved to the cache directory with a randomly generated filename.
// Using default destination (cache directory with random filename)
val file = FileKit.openCameraPicker()

// Specifying a custom destination
val customFile = FileKit.filesDir / "my_photo.jpg"
val file = FileKit.openCameraPicker(destinationFile = customFile)
The captured media file is automatically saved to a temporary location. If you need to keep the file permanently, make sure to copy it to a permanent storage location.