Put Pit Log under version control so the app and sync server can live on git.
This commit is contained in:
commit
1030bac79e
79 files changed
+8463
No files matched your search
@@ -0,0 +1,25 @@
|
||||
package com.racingapp.pitlog
|
||||
|
||||
import android.app.Application
|
||||
import com.racingapp.pitlog.data.AppDatabase
|
||||
import com.racingapp.pitlog.data.PitSync
|
||||
import com.racingapp.pitlog.data.Repository
|
||||
import com.racingapp.pitlog.data.SyncPreferences
|
||||
import com.racingapp.pitlog.data.ensureCars
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
open class RacingApp : Application() {
|
||||
lateinit var repository: Repository
|
||||
private set
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
val dao = AppDatabase.create(this).raceDao()
|
||||
val preferences = SyncPreferences(this)
|
||||
runBlocking(Dispatchers.IO) { ensureCars(dao, preferences) }
|
||||
val sync = PitSync(this, dao, preferences)
|
||||
repository = Repository(dao, sync, preferences)
|
||||
sync.schedule()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user