The upload flow in Java with XML views. The app is pure Java (no Kotlin plugin) and talks to the
Kotlin :uploader SDK directly, so it's a handy reference if your codebase is Java.
- Put your
fastpix.tokenandfastpix.secretKeyin the project-rootlocal.properties(see ../README.md). - Open the project in Android Studio, select the
java-xmlmodule, and Run. - Pick a file, tap Start, then use Pause / Resume / Abort. Send the app to the background and the upload keeps going, with progress in a notification.
MainActivity.java— the screen; observesUploadManagerbetweenonStartandonStop.UploadManager.java— holds the running upload and notifies observers.UploadService.java— foreground service that keeps the upload alive in the background.FastPixApi.java— the "create upload" API call.Config.java— credentials and chunk size.
One Java quirk worth knowing: the SDK's UploadListener is a Kotlin interface, so the anonymous
implementation has to override all nine callbacks — Java doesn't see Kotlin's default methods.
See ../README.md for how the background upload works.