I advise you to do like this.
Get current time
Decide final time and convert into millis…save into tinydb
When screen inti or started timer, get current time(online time) convert into millis, then add +1000.
By using datetool extension you can find the difference between current time with tinydb final time and convert into HH mm ss without internet.
Simple…
Else test this APK