| | |
| | | import com.example.firstapp.database.repository.CodeRepository |
| | | import com.example.firstapp.database.repository.KeywordRepository |
| | | import com.example.firstapp.database.repository.MsgRepository |
| | | import com.example.firstapp.database.repository.ReminderRepository |
| | | import com.example.firstapp.database.service.RetrofitClient |
| | | import com.example.firstapp.receiver.CactusReceiver |
| | | import com.example.firstapp.service.ReminderWorker |
| | |
| | | val msgRepository by lazy { MsgRepository(database.msgDao()) } |
| | | val codeRepository by lazy { CodeRepository(database.codeDao()) } |
| | | val keywordRepository by lazy { KeywordRepository(RetrofitClient.apiService,database.keywordDao()) } |
| | | val reminderRepository by lazy { ReminderRepository(this) } |
| | | |
| | | companion object { |
| | | const val TAG: String = "SmsForwarder" |
| | |
| | | context = applicationContext |
| | | initLibs() |
| | | PreferencesManager.init(this) |
| | | // 初始化RetrofitClient |
| | | RetrofitClient.init(this) |
| | | |
| | | try { |
| | | if (SettingUtils.enablePureClientMode) return |
| | |
| | | |
| | | // 仅在特定时间执行(每天指定时间) |
| | | // 可根据需要设置多个不同时间点的提醒 |
| | | ReminderWorker.setupScheduledWorker(this, 9, 0) // 上午9:00 |
| | | ReminderWorker.setupScheduledWorker(this, 13, 50) // 下午13:50 |
| | | //ReminderWorker.setupScheduledWorker(this, 9, 50) // 上午9:00 |
| | | ReminderWorker.setupScheduledWorker(this, 10, 50) // 下午13:50 |
| | | |
| | | // 不再使用周期性轮询和立即执行的方式 |
| | | } |