VpsLocalLocationSource
Parameters
application context.
directory containing the downloaded map database files.
mapdata
optional CameraX preview surface. When supplied, the source binds a live camera preview alongside its capture use case so the app can show the feed while scanning; the source owns the camera, so apps must NOT bind their own camera session. Pass null for headless (no preview).
The preview stream is bound at a small resolution deliberately, which keeps its cost to roughly 16 ms per scan (measured on a Galaxy S21: 365 ms of capture time without a preview, 381 ms with one). Left at CameraX's default preview resolution the same binding cost ~625 ms per scan, so do not remove that cap — see CameraCapture.
optional configuration that keeps scanning alive while the app is backgrounded or the screen is off, via a camera-type foreground service (VpsLocalForegroundService). When null (the default), scanning only runs while the app is in the foreground. When supplied, the consuming app MUST declare the service and its permissions in its own manifest — see VpsLocalForegroundService.