Download Progress Activity
DownloadProgressActivity handles the downloading of model files required for the SenseCrypt SDK.
Key Features:
Progress Bar UI: Shows real-time download progress
Error Handling: Uses UIHelper for consistent error presentation
Download Management: Handles model file downloads and status checks
Cleanup: Properly cleans up resources on error/cancellation
Error Handling Strategy:
All errors (network, server, etc.) are treated as unrecoverable
No retry option is provided to ensure clean app state
If error occurs during initial app launch (from MainActivity):
Shows error dialog
On dialog close, finishes all activities (closes app)
If error occurs during manual download (from Settings):
Shows error dialog
On dialog close, returns to previous screen
Download Process:
Start download session
Monitor download progress
On completion: Initialize SDK and proceed
On error: Show dialog and close/return based on launch source
Properties
Functions
Initiates the download of required model files.
Checks if the directory exist and if not then it will create a directory in the application folder
This function gets executed when the models download have been completed
When the cancel button is clicked or exception have been thrown during download session this function gets executed
Monitors and updates the download progress.