오늘의 날씨

-

GitHub

-

언어, 라이브러리

  • Kotlin
  • Coroutines
  • ViewBinding
  • Room
  • Retrofit
  • DataStore
  • WorkManager
  • AlarmManager
  • Dagger-hilt
  • Glide
  • Lottie
  • FirebaseAnalytics
  • FirebaseCrashlytics

-

아키텍쳐

-

WorkManager + AlarmManager

abstract class HiltBroadcastReceiver: BroadcastReceiver() {
    @CallSuper
    override fun onReceive(context: Context, intent: Intent) {}
}

@AndroidEntryPoint
class AlarmReceiver: HiltBroadcastReceiver() {

    override fun onReceive(context: Context, intent: Intent) {
        super.onReceive(context, intent)

        WorkManager.getInstance(context).enqueueUniqueWork(
            DOWNLOAD_WEATHER_DATA_WORKER_NAME,
            ExistingWorkPolicy.KEEP,
            OneTimeWorkRequestBuilder<DownloadWeatherDataWorker>()
                    .setBackoffCriteria(BackoffPolicy.LINEAR, 1, TimeUnit.MINUTES)
                    .build()
        )
        
        ...
    }
}

-

날씨 데이터 출처

기상청, 에어코리아

-

플레이 스토어

오늘의 날씨 🌤

좋은 웹페이지 즐겨찾기