# Phone gallery preview

## Purpose

Show how the phone crawls externally stored artefacts produced by demos and previews them safely.

## Entry points

Phone home:

- `MainPhoneActivity` → `GalleryActivity`

Sample Activities:

- `com.rokid.phone.GalleryActivity`  
- `com.rokid.phone.ImagePreviewActivity`

## Platform

- Phone

## Main files

- [GalleryActivity.kt](https://gitee.com/as_pixar/glass3sdkdemo/blob/main/glass3sdkphonedemo/app/src/main/java/com/rokid/phone/GalleryActivity.kt)
- [ImagePreviewActivity.kt](https://gitee.com/as_pixar/glass3sdkdemo/blob/main/glass3sdkphonedemo/app/src/main/java/com/rokid/phone/ImagePreviewActivity.kt)

## Flow

1. Walk `getExternalFilesDir(null)` subtree.  
2. Recursively classify images/video candidates.  
3. Route taps → `ImagePreviewActivity` for stills or `FileProvider` playback for clips.

## FAQ

### Why only app sandbox storage

Demonstrates artefacts generated via partner flows—not the global photo roll.

### Supported codecs

Still: `jpg/jpeg/png`. Motion: `mp4/avi/mov`.

## Caveats

- If no Activity can resolve video playback intents, toast failure.  
- Replace with `MediaStore` queries when you need handset-wide galleries.
