Skip to content
Back to skills

Android Networking

ASecurity

Standards for Retrofit, OkHttp, and API Communication. Use when integrating Retrofit, OkHttp, or API clients in Android apps. (triggers: **/*Api.kt, **/*Service.kt, **/*Client.kt, Retrofit, OkHttpClient, @GET, @POST)

  • 65 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 30, 2026
developmentkotlintestingapibackendsecurity

Works with

  • cli
  • api

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ComeOnOliver/skillshub --skill android-networking --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Android Networking?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Android Networking
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/comeonoliver-android-networking/badge)](https://www.skillsdirectory.com/skills/comeonoliver-android-networking)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: android-networking
description: 'Standards for Retrofit, OkHttp, and API Communication. Use when integrating Retrofit, OkHttp, or API clients in Android apps. (triggers: **/*Api.kt, **/*Service.kt, **/*Client.kt, Retrofit, OkHttpClient, @GET, @POST)'
---

# Android Networking Standards

## **Priority: P0**

## Implementation Guidelines

### Libraries & Setup

- **Client**: Use **Retrofit 2** with **OkHttp 4** for all backend communication.
- **Serialization**: Use **Kotlinx Serialization** (preferred). Use **`@SerialName`** for JSON field mapping.
- **Security**: Implement **Certificate Pinning** for sensitive production domains. Use **`NetworkSecurityConfig`** for cleartext traffic control.

### Network Ops

- **Interceptors**: Use **OkHttp Interceptors** for global concerns like **`Bearer token`** injection via the **`Authorization` header** and **`HttpLoggingInterceptor`** (debug only).
- **Architecture**: All API calls must be **`suspend` functions**. Use a **`Result` wrapper** or **`Either`** to handle success/failure in the Repository layer.
- **Minification**: Ensure **`isMinifyEnabled`** is true in `build.gradle` and define **R8/ProGuard rules** for Retrofit/OkHttp to prevent runtime crashes.
- **Testing**: Use **MockWebServer** to simulate API responses in unit and integration tests. Ensure **100% test coverage** for error cases (500, 401, 403).

## Anti-Patterns

- **No Blocking Network Calls**: All API functions must be suspend.
- **No Logic in API Interface**: Only declare endpoints — handle errors in Repository.
- **No Raw Converter Factory**: Explicitly set "application/json" MediaType with kotlinx.serialization.

## References

- [Setup & Wrappers](references/implementation.md)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.