android-networking

Build and review Android Retrofit and OkHttp networking layers.

1|Updated Feb 28, 2026
One-click install
npx skills add https://github.com/Binh230199/ai --skill android-networking
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-networking
Source: https://github.com/Binh230199/ai/tree/main/.github/skills/android-networking
Command: npx skills add https://github.com/Binh230199/ai --skill android-networking

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you design, review, and debug Android networking code so API calls are reliable, secure, testable, and easier to maintain.

Core Features & Use Cases

  • Retrofit API Design: Build typed suspend-based service interfaces for clean REST integration.
  • OkHttp Client Setup: Configure interceptors, logging, retries, timeouts, authentication, and certificate pinning correctly.
  • Error Handling and Mapping: Convert HTTP and network failures into domain-safe results before they reach the UI.
  • Testing and Validation: Use fakes and MockWebServer to verify networking behavior without calling real services.
  • Use Case: A mobile team can use this Skill to implement a secure media API layer, add token refresh handling, prevent release logging leaks, and stabilize flaky network tests.

Quick Start

Ask the skill to implement or review an Android Retrofit and OkHttp network layer for your feature, including DTOs, interceptors, error handling, and tests.

Frequently Asked Questions about android-networking

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a Retrofit and OkHttp networking layer for Android?

Build a reliable Android networking layer using typed suspend-based Retrofit service interfaces and OkHttp client configuration with interceptors, timeouts, and Hilt wiring for clean REST integration.

How does certificate pinning work with OkHttp in Android?

Certificate pinning secures OkHttp API calls by restricting trusted certificates to prevent man-in-the-middle attacks. You configure it within your OkHttp client setup alongside authentication and release-safe logging interceptors.

What is the best way to handle HTTP error mapping in Android Retrofit?

Handle HTTP error mapping in Retrofit by converting HTTP and network failures into domain-safe results before they reach the UI, ensuring API call errors are typed and securely managed.

How do I test Android networking code without calling real services?

Test Android networking code without real services by using fakes and MockWebServer to verify API behavior, validating Retrofit service interfaces and OkHttp interceptors in isolated environments.

How do I add token refresh handling to an Android OkHttp interceptor?

Add token refresh handling to OkHttp interceptors by configuring authentication logic within the client setup, managing token expiration dynamically during API calls to ensure continuous Retrofit service operation.

Why do I need Hilt wiring for my Android networking layer?

Hilt wiring provides consistent dependency injection for Retrofit and OkHttp clients, ensuring suspend-based APIs and typed DTOs are correctly configured and available across your Android app's features.