android-retrofitlisted
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