This repository contains the Android application for the ScreenLife Capture research study conducted by the ASSIST Lab at University of Wisconsin-Madison. The application enables participants to automatically record screenshots, capture location data, and record video at specified intervals for behavioral research purposes.
App Name: UW ASSIST Lab ScreenLife Package ID: edu.wisc.chm.screenomics Current Version: 1.13 (Build 15) Target SDK: 35 Min SDK: 29
- Automated Screenshot Capture: Takes screenshots at configurable intervals
- Location Tracking: Records GPS coordinates every 10 seconds
- Video Recording: Currently disabled - will be re-enabled in future version
- Secure Data Upload: Encrypted data transmission to research servers
- Background Operation: Runs continuously as a foreground service
- Batch Processing: Groups data for efficient network transmission
The application integrates with the new MindPulse Receiver server, which validates cryptographically signed requests and enforces anti-replay protection.
- Canonical Request Signing: Each upload request is signed with the device’s private key, and the server verifies authenticity via the stored public key.
- Structured Signature Header: Follows the HTTP Signatures spec with a canonical string and timestamp.
- Anti-Replay Protection: Adds
X-Request-NonceandX-Request-Timestampheaders per request. - Batch Upload Endpoint: Uses
/api/v1/img/{study_id}/{participant_id}for uploads. - Server Response Logging: All responses and hashes are recorded in local logs.
| Activity | Purpose | Features |
|---|---|---|
MainActivity |
Primary user interface with tabbed layout | Start/stop capture, view status, access logs |
RegisterActivity |
User registration and key generation | Participant name entry, encryption key creation |
DevToolsActivity |
Configuration and debugging tools | Batch size adjustment, parallel upload settings |
| Service | Type | Purpose |
|---|---|---|
CaptureService |
Foreground (MediaProjection) | Screenshot capture and app tracking |
LocationService |
Foreground (Location) | GPS coordinate recording |
VideoCaptureService |
Foreground (Camera) | Disabled - to be re-enabled in future version |
UploadService |
Background | Batch data upload to server |
| Component | Purpose |
|---|---|
Constants |
Application-wide configuration constants |
Batch |
Data structure for grouped file uploads |
Encryptor |
Data encryption and security utilities |
Logger |
SharedPreferences-based logging system |
UploadScheduler |
Automated upload timing and scheduling |
SenderWorker |
Background work manager for data transmission |
LocationWorker |
Kotlin-based location tracking worker |
InternetConnection |
Network connectivity and type detection |
Converter |
Data format conversion utilities |
| Fragment | Purpose |
|---|---|
ScreenLifeFragment |
Screenshot capture controls and status |
MindPulseFragment |
Currently hidden - to be re-enabled in future version |
The Constants.java file contains key configuration parameters:
| Constant | Value | Purpose |
|---|---|---|
UPLOAD_ADDRESS |
Configured in Constants.java | Primary data upload endpoint |
BATCH_SIZE_DEFAULT |
10 |
Number of items per upload batch |
MAX_TO_SEND_DEFAULT |
0 |
Maximum items to send (0 = no limit) |
MAX_BATCHES_TO_SEND |
10 |
Maximum concurrent batch uploads |
REQ_TIMEOUT |
1200 |
Network request timeout (seconds) |
The application requires extensive permissions for data collection:
INTERNET- Network data uploadWAKE_LOCK- Prevent device sleep during captureFOREGROUND_SERVICE- Background operationSYSTEM_ALERT_WINDOW- Overlay interface elements
FOREGROUND_SERVICE_MEDIA_PROJECTION- Screenshot capture- Video recording (disabled)FOREGROUND_SERVICE_CAMERAACCESS_FINE_LOCATION/ACCESS_BACKGROUND_LOCATION- GPS trackingPACKAGE_USAGE_STATS- App usage tracking- Video/audio capture (disabled)CAMERA/RECORD_AUDIO
READ_EXTERNAL_STORAGE/WRITE_EXTERNAL_STORAGE- File operationsRECEIVE_BOOT_COMPLETED- Auto-start after device rebootSCHEDULE_EXACT_ALARM- Precise timing for data collection
- Android Studio
- Gradle 7.0+
- Android SDK 29+
- Google Services (Firebase integration)
- Compile SDK: 34
- Target SDK: 33
- Min SDK: 29
- Java Version: 1.8
- Kotlin Support: Enabled
- AndroidX libraries
- Google Play Services
- Firebase Crashlytics
- Joda Time for date/time operations
- WorkManager for background tasks
- Data Encryption: All captured data is encrypted using the
Encryptorclass - No Backup: Backup is disabled (
android:allowBackup="false") - Secure Storage: Uses Android's secure storage mechanisms
- Network Security: HTTPS-only communication with research servers
- Cryptographic Signatures: Each batch request is signed using RSA (SHA-256) to verify authenticity.
- Anti-Replay Protection: Server rejects reused nonces or stale timestamps.
- AGP 8.5.2 Upgrade: Upgraded Android Gradle Plugin from 8.2.0 to 8.5.2 for native 16 KB support
- Gradle 8.7 Upgrade: Updated Gradle wrapper to version 8.7
- Kotlin 1.9.0: Updated Kotlin to version 1.9.0 for compatibility
- Native Library Auto-Alignment: AGP 8.5.2+ automatically aligns all native libraries to 16 KB boundaries
- jcenter() Deprecated: Migrated from deprecated jcenter() to mavenCentral()
- Critical Fix: Final solution for Google Play 16 KB requirement (deadline: November 1, 2025)
- Attempted to use compressed libraries (useLegacyPackaging = true)
- Did not solve the root cause (ELF segment alignment)
- Initial 16 KB support attempt with experimental flags
- Updated targetSdk to 35
- Updated CameraX to 1.3.4
- Video Recording Restored: Full video recording functionality re-enabled
- Recording Timer: Added real-time duration display (MM:SS format)
- Audio Volume Indicator: Visual feedback showing microphone input levels
- Green to yellow to red gradient indicating volume intensity
- Real-time monitoring at 100ms intervals
- Enhanced UI: Improved recording interface with live feedback
- Camera and audio permissions restored
- MindPulse tab re-enabled with enhanced features
- Video recording temporarily disabled for production release
- MindPulse features hidden from interface