This guide reflects the current Kotlin app under android/app.
| Setting | Current value |
|---|---|
compileSdk |
35 |
targetSdk |
35 |
minSdk |
24 |
| Java / JVM target | 17 |
| Kotlin | 2.0.21 |
The version catalog lives in android/gradle/libs.versions.toml.
cd android
.\gradlew assembleDebugInstall onto a connected device:
.\gradlew installDebugDebug APK output:
android/app/build/outputs/apk/debug/app-debug.apk
The app expects both assets in android/app/src/main/assets/:
span_education_x3.tflitespan_education_x2.tflite
These are used by ModelManager to map input resolution to output target:
| Input class | Asset | Output target |
|---|---|---|
| 144p | span_education_x3.tflite |
360p |
| 240p | span_education_x3.tflite |
720p |
| 360p | span_education_x2.tflite |
720p |
models/conversion/convert_span_x3.py now handles both x3 and x2 SPAN
checkpoints by inferring the scale from the checkpoint payload.
python models/conversion/convert_span_x3.py --checkpoint models/span/education-finetuned/x3-real-refine-20260412/best_model.pt --output_dir outputs/mobile-export/x3-real-refine-20260412 --tflite_name span_education_x3.tflite
python models/conversion/convert_span_x3.py --checkpoint models/span/education-finetuned/x2-v3-tpgsr-refine-20260411/last_model.pt --output_dir outputs/mobile-export/x2-v3-tpgsr-refine-20260411-last --tflite_name span_education_x2.tflite
copy outputs\mobile-export\x3-real-refine-20260412\span_education_x3.tflite android\app\src\main\assets\span_education_x3.tflite
copy outputs\mobile-export\x2-v3-tpgsr-refine-20260411-last\span_education_x2.tflite android\app\src\main\assets\span_education_x2.tflite| Area | Main files |
|---|---|
| application setup | EduScaleApplication.kt |
| model loading and inference | ml/ModelManager.kt |
| segment-based video pipeline | processing/VideoProcessor.kt |
| desktop-like frame cache for single images | processing/FrameEnhancer.kt |
| OCR and quality metrics | processing/QualityMetrics.kt |
| downloads and enhancement jobs | worker/VideoDownloadWorker.kt, worker/VideoEnhancementWorker.kt |
| persisted settings | data/SettingsRepository.kt |
| UI state and screens | ui/viewmodel/MainViewModel.kt, ui/screens/* |
The Android app uses WorkManager for two queues:
- video enhancement jobs
- YouTube download jobs
Important storage locations:
| Location | Purpose |
|---|---|
filesDir/enhanced_videos/ |
completed processed videos |
filesDir/downloads/ |
downloaded source videos |
DataStore settings |
user preferences such as GPU and cache options |
Enhanced videos are shared through the app FileProvider declared in
res/xml/file_paths.xml.
Local unit tests:
cd android
.\gradlew testDebugUnitTestThere are Kotlin tests for segment detection and bitmap sharpening under
android/app/src/test/java/com/james/eduscale/processing/.
- Missing SDK: open the project once in Android Studio so
local.propertiesis generated. - Missing assets: verify both TFLite files exist and are non-empty.
- GPU delegate errors: CPU fallback is expected on unsupported devices.