Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Retrofit

Retrofit manages HTTP requests and maps API endpoints to Kotlin interfaces.

How is JSON converted to data classes

Gson converts JSON responses into Kotlin data classes such as WeatherResponse. The mapping happens automatically based on field names.

How does a coroutine work here

API calls are executed in background threads using suspend functions and coroutines. The UI updates when the coroutine returns the data.

How does the UI state work

A ViewModel holds a WeatherUiState object that represents the screen state. Jetpack Compose observes state changes and recomposes the UI automatically.

How is the API key stored

The API key is placed in local.properties, injected into BuildConfig at build time, and accessed by Retrofit at runtime.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages