This Android application serves as a lightweight native wrapper for the Orin Camera Aggregator web application. Its primary responsibility is to bridge the native user input with the web-based recording workflow and manage the application lifecycle based on network signals.
This app acts as the mobile host for the Orin WebView-based workflow. It does not implement recording logic, file handling, or backend communication directly; it delegates these tasks to the web application running within the WebView.
- Launch the Orin web frontend.
- Pass a
userIdinto the recording session. - Detect session completion via network interception.
- Reset the UI state for the next user.
The app initiates a session by loading the web frontend with a user-provided identifier passed as a query parameter.
- URL Pattern:
http://<host>:4173/setup?userId=<USER_ID> - Input: The
userIdis supplied via a native input field on the start screen.
The web application signals the end of a workflow by sending a background network request. The native app listens for this specific signal to close the view.
- Trigger Endpoint:
POST http://<host>:4000/finish-session - Mechanism: The web app uses
fetch()to send this request.
Since /finish-session is a background POST request (and not a navigation event), the standard shouldOverrideUrlLoading will not catch it. Instead, the app uses WebViewClient.shouldInterceptRequest(...).
Logic Flow:
- Monitor: The
WebViewClientmonitors all outgoing requests. - Detect: When a request matching the
/finish-sessionpath is detected:
- The app hides the WebView.
- The app navigates back to the initial start screen.
- A minimal
200 OKresponse is returned to the WebView to prevent console errors.
- Lifecycle: The app does not exit; it resets to allow a new
userIdentry.
- Start: App launches to a native input screen.
- Input: User enters
userId. - Action: User taps "Open Session".
- Active: WebView opens in fullscreen mode; user completes the web workflow.
- Finish:
/finish-sessionis intercepted. - Reset: User is immediately returned to the native start screen.
This document outlines the architecture, file management, and integration points for the Orin Camera Aggregator application.
This application is designed to function as a WebView embedded within a native mobile host application. It acts as a local controller for connected hardware (Android, Hyperspectral and Realsense cameras), managing recording sessions and data integrity.
The application runs a web frontend that communicates with local Python backend services.
- Session Termination: The specific route /finish-session signals the end of the user workflow. The native mobile wrapper must listen for navigation to this route to trigger the closing of the WebView.
The system uses a synchronized start/stop mechanism across connected devices.
- Method: POST
Behavior:
- Accepts a user ID or session identifier.
- UUID Generation: To ensure file uniqueness and prevent overwriting, the backend automatically appends a random UUID to the provided identifier.
- Locking: Creates a lock file (e.g., .lock.android) to prevent concurrent recording requests.
- Method: POST
Behavior:
- Stops the camera pipelines safely.
- Keepalive: Browser safety protocols use fetch with keepalive: true to ensure stop commands are sent even if the WebView is closed immediately.
- Cleanup: Removes lock files upon successful stop.
Storage paths are strictly defined via container orchestration.
- Source: docker-compose.yml
- Environment Variable: OUTPUT_PATH
- Mechanism: The application writes to a specific directory defined in the Docker Compose configuration. This directory is mounted as a volume to ensure persistence outside the container.
To ensure data reliability during the transfer to the cloud, the system employs a pre-upload hashing strategy.
Files are generated using a composite naming structure: [USER_ID]-[UUID]_[SUFFIX].[EXTENSION] Example Output: text -rw-r--r-- 1 root root 397854 Dec 26 11:19 ASDSKLAJDAKS-b74711d8-1a71-45e1-8702-385bbe1f6c19_android_gray_blurred_web.mp4 -rw-r--r-- 1 root root 6335301 Dec 26 11:19 ASDSKLAJDAKS-b74711d8-1a71-45e1-8702-385bbe1f6c19.mp4.enc
- Generation: Once a recording is finalized, the system calculates a cryptographic hash of the file.
- Transmission: This hash is sent to the Upload Service alongside the file metadata before the upload begins.
- Verification: After the file is uploaded, the Upload Service recalculates the hash of the received file and compares it against the provided hash to confirm that no data corruption occurred during transfer.
- UserID
- date
- camera_name
- encrypted_files
- raw_files
- calibration files