Package 

Object CSVMode


  • 
    public class CSVMode
    
                        

    Debug-only "CSV-only" recording mode (parity with iOS csvOnlyMode).

    When enabled, the SDK skips network upload entirely. Instead, while a delivery is active:

    • The fused motion stream and the raw accel/gyro/mag streams go to a SQLite database in the session directory (one row per sample), which is exported to per-stream CSV files when the delivery stops.

    • Lower-rate streams are appended directly to per-stream CSVs as they arrive: altitude.csv, location.csv, wifi.csv, gnss_status.csv, gnss_measurement.csv, gnss_nav.csv, gnss_ephemeris.csv, gnss_satellite_position.csv. WiFi rows are flattened so each AP in a scan is its own row; GNSS measurements/status are flattened the same way, with parent event/clock fields repeated per row.

    • Trigger events (newEvent, markDropoff) are appended to events.csv instead of being PATCHed to /v1/session/event/…, so a local capture still carries its dropoff/POD markers. Events raised outside an open CSV session (before collection starts, after it stops) are dropped with a warning rather than minting a stray session directory.

    Toggle from the test app UI / instrumentation via CSVMode.enabled; check CSVMode.lastSessionDirectory after the delivery has stopped to retrieve the export, or call shareLastSession to fire a system share sheet with every CSV in the directory.

    Production callers should leave this false. Mirrors the iOS csvOnlyMode: Bool and lastCSVSessionDirectory: URL? runtime flags.

    • Method Detail

      • shareLastSession

         final Boolean shareLastSession(Context context, String authority)

        Open the platform share sheet with all CSV files in lastSessionDirectory. Returns false if there is nothing to share.

        The host app must declare a FileProvider with authority ${applicationId}.doorstepai.csvprovider (or pass a custom one via authority) and grant access to the SDK's external files dir. See the sample app's AndroidManifest.xml and file_paths.xml for the minimal config.

      • getEnabled

         final Boolean getEnabled()

        When true, sensor data is written to CSV files instead of being uploaded to the server. Default false — production builds must not flip this on.

      • setEnabled

         final Unit setEnabled(Boolean enabled)

        When true, sensor data is written to CSV files instead of being uploaded to the server. Default false — production builds must not flip this on.

      • getLastSessionDirectory

         final File getLastSessionDirectory()

        Set by the SDK when a CSV session directory is created. Reset to null before the next session starts. Reads of this from the host app should happen afterstopDelivery(...) returns to ensure the export has been flushed.