Proof of concept
CamToPhoneUSB is an app that tethers a camera to a phone or tablet over USB OTG. After you grant USB permission and connect a supported body in tether or PC Remote mode, it talks to the camera over PTP using libgphoto2. When you take a shot, the app detects new files on the camera, downloads them, and saves them on the device (under PICTURES/USB_IMAGES/). Compatibility varies by camera and mode.
- Connect a supported camera to an Android phone or tablet via USB OTG
- Grant USB permission in the app
- When you shoot, the app listens for new files over PTP (via libgphoto2)
- Downloads images and saves them under
PICTURES/USB_IMAGES/
Tested in development with Sony bodies (e.g. Sony in PC Remote mode). Vendor IDs for Sony, Canon, Fujifilm, Panasonic, Nikon, Olympus, Pentax/Ricoh, and Leica are added, but compatibility varies, as it's not tested.
- Android 10+ (API 29+)
- USB OTG cable or adapter
- Camera in a USB tether / PC Remote / similar mode (camera-dependent)
The app depends on prebuilt native libraries (libgphoto2 and friends). Build those first on WSL, then build the APK on Windows.
WSL cannot use the Windows NDK toolchain directly. The script uses your Linux NDK if available, or downloads the Linux NDK on first run.
Install build tools once:
sudo apt install -y git autoconf automake libtool make pkg-config texinfo help2man unzip curl autopointPoint out your Windows NDK path (or set ANDROID_NDK_HOME to a Linux NDK), then run:
export ANDROID_NDK_HOME=/mnt/c/Users/YOU/AppData/Local/Android/Sdk/ndk/28.0.13004108
cd /mnt/c/path/to/CamToPhoneUSB
./scripts/build_libgphoto2_android.shWhat the script does:
- Cross-compiles libtool, libusb, and libgphoto2 (default v2.5.33) for
arm64-v8aandarmeabi-v7a - Applies
scripts/patches/libgphoto2-android-usb-open.patchfor Android USB file-descriptor support - Copies
.sofiles and headers intoapp/src/main/jniLibs/<abi>/
Intermediate build files go to ~/.gphoto2-android-build when the repo is on /mnt/c (faster than building on the Windows filesystem).
More detail: docs/LIBGPHOTO2_ANDROID.md
.\gradlew.bat :app:assembleDebugOutput: app/build/outputs/apk/debug/app-debug.apk
Camera support comes from dynamically linked native libraries built from upstream sources:
| Component | License | Source |
|---|---|---|
| libgphoto2 | LGPL-2.1+ | Built by scripts/build_libgphoto2_android.sh |
| libusb | LGPL-2.1+ | Same script |
| libltdl (GNU libtool) | LGPL-2.1+ | Same script |
If you ship an APK that includes these .so files, LGPL requires that users can replace them (dynamic linking satisfies this) and that license notices are available. Upstream license texts: libgphoto2 COPYING, libusb COPYING. Any local changes to libgphoto2 are in scripts/patches/.
- Live view
- Remote camera settings
- Wi‑Fi PTP/IP
- Polished UX or broad device QA
