Skip to main content
Module: LCKAndroidGallery | Version: 1.0 | Platforms: Android only

Overview

LCKAndroidGallery provides functions to save recorded videos and captured photos to the Android device’s media gallery. Files are published through the Android MediaStore API, making them visible in the device’s gallery app and accessible to other applications. Videos are saved to Movies/<GameName>/ and images to Pictures/<GameName>/, where <GameName> is read from your LCK project settings (falling back to the Unreal project name).

When to Use

Use these functions after:
  • A recording completes via StopRecording() or StopRecordingAsync() to save the video to the user’s gallery
  • A photo is captured via TakePhoto() to save the image to the user’s gallery
Files saved through LCKAndroidGallery appear immediately in the device gallery app. Without this step, recorded files remain in the app’s internal storage and are not visible to the user.

Functions

SaveVideoToGallery

Copies a video file to the Android MediaStore and reports copy progress via a callback.
The video is saved to Movies/<GameName>/<GameName>_<timestamp>.mp4 in the device’s shared storage.

SaveImageToGallery

Copies an image file to the Android MediaStore.
The image is saved to Pictures/<GameName>/<GameName>_<timestamp>.png in the device’s shared storage.

Usage Examples

Save Video After Recording

On Android, the encoder’s Save() method automatically calls SaveVideoToGallery() internally. You do not need to call it manually — the video is saved to the Android MediaStore (Gallery) as part of ReleaseEncoder(bSaveFile = true) or StopRecordingAsync(). The temp file is located at FPaths::ProjectPersistentDownloadDir() / TEXT("lck.mp4").
If you need to save a video file manually (e.g., from a custom location):

Save Photo After Capture

Platform Notes

LCKAndroidGallery is Android only. These functions use JNI to interact with the Android MediaStore API and will not compile on other platforms. Guard calls with platform checks if your project targets multiple platforms.

Permissions

LCKAndroidGallery uses the Android MediaStore ContentResolver API (available on Android 10 / API 29+), which does not require runtime storage permissions for writing to shared media directories. For devices running Android 9 (API 28) or earlier, you need:
If your project targets API 29+, no additional permissions are needed. The MediaStore API handles scoped storage access automatically.

File Naming

Saved files follow the naming convention:
The game name is resolved from your LCK project settings (GameName in LCKSettings). If not configured, the Unreal project name is used as a fallback.

Dependencies

Log Category

Troubleshooting

  1. Confirm you are calling from the game thread
  2. Check that the Android activity is valid and not suspended
  3. Review logcat output for Java exceptions
  1. Verify the OnProgress callback is valid (not null)
  2. The callback fires per 4KB chunk — very small files may complete in a single call

See Also

Recording

Recording subsystem and lifecycle

Core SDK Overview

SDK architecture and modules