← ClaudeAtlas

android-retrofitlisted

Retrofit and OkHttp per the Retrofit docs and Google's data layer guide: service declarations, return types, remote data sources, Hilt and OkHttp setup, interceptors, auth, logging, errors, R8, MockWebServer tests. Use when adding or changing HTTP calls, and for 401 refresh loops, KotlinNullPointerException on empty bodies, SerializationException, dropped base URL paths, or release-only failures.
pablitoarango/android-skills · ★ 3 · Testing & QA · score 74
Install: claude install-skill pablitoarango/android-skills
# Retrofit and OkHttp in the Data Layer Sources of truth: [Data layer](https://developer.android.com/topic/architecture/data-layer), [Connect to the network](https://developer.android.com/develop/connectivity/network-ops/connecting), [Network security configuration](https://developer.android.com/privacy-and-security/security-config), [Retrofit documentation](https://lysine.dev/retrofit/), [Retrofit repository](https://github.com/lysine-dev/retrofit), [OkHttp logging interceptor](https://github.com/lysine-dev/okhttp/tree/main/okhttp-logging-interceptor), [OkHttp documentation](https://lysine.dev/okhttp/), [MockWebServer](https://github.com/lysine-dev/okhttp/tree/main/mockwebserver). Read versions from [Retrofit releases](https://github.com/lysine-dev/retrofit/releases), the [OkHttp changelog](https://github.com/lysine-dev/okhttp/blob/main/CHANGELOG.md) and [kotlinx.serialization releases](https://github.com/Kotlin/kotlinx.serialization/releases). Never hardcode them in code samples. ## 1. Where Retrofit sits ``` ViewModel / use case └── NewsRepository public; the only entry point └── NewsRemoteDataSource internal; wraps the API └── NewsApi internal Retrofit interface ``` - **Only a remote data source injects a Retrofit interface.** Repositories, use cases, ViewModels and composables never do (`android-data-layer`). - **Name by role.** The Retrofit interface is `<Type>Api` (`NewsApi`) and the class wrapping it is `<Type>RemoteDataS