android-api-client

Build Android API clients with Retrofit, OkHttp, and Kotlinx Serialization.

3|Updated Sep 29, 2025
One-click install
npx skills add https://github.com/xtone/ai_development_tools --skill android-api-client
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-api-client
Source: https://github.com/xtone/ai_development_tools/tree/main/android_development/.claude/skills/android-api-client
Command: npx skills add https://github.com/xtone/ai_development_tools --skill android-api-client

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a structured approach to building robust Android API clients using Retrofit and OkHttp, reducing boilerplate and common integration errors.

Core Features & Use Cases

  • API Service Definition: Clearly defined Retrofit interfaces for common endpoints.
  • Networking Configuration: Centralized OkHttp client with interceptors for authentication, logging, and retry logic.
  • Error Handling: Consistent ApiResult/ApiError patterns and safe API call wrappers.
  • Use Case: In a mobile app, implement a network layer that handles token refresh, request retries, and robust parsing with kotlinx.serialization.

Quick Start

Use this pattern to scaffold Retrofit + OkHttp-based data layer and integrate a safe API wrapper for your Android app.

Frequently Asked Questions about android-api-client

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

FAQPage Schema
How do I configure a Retrofit and OkHttp API client for an Android app?

To configure a Retrofit and OkHttp API client, define typed Retrofit interfaces for endpoints and centralize OkHttp setup with interceptors for authentication, logging, and retry logic to ensure consistent network operations.

What is the best way to handle API errors in Android networking?

The best way to handle API errors in Android networking is using consistent ApiResult and ApiError patterns. Safe API call wrappers standardize error handling across UI, domain, and data layers for robust network operations.

How does kotlinx.serialization work with Retrofit on Android?

Kotlinx.serialization works with Retrofit on Android by providing robust, typed parsing for network responses. This integration reduces boilerplate and common integration errors when mapping JSON payloads to Kotlin data classes.

Can I use OkHttp interceptors for token refresh and request retries?

Yes, you can use OkHttp interceptors for token refresh and request retries. A centralized OkHttp client applies interceptors to manage authentication, logging, and retry logic across all network operations.

When do I need a centralized networking configuration in an Android app?

You need a centralized networking configuration in an Android app when multiple UI, domain, and data layers require standardized error handling, consistent request retries, and unified token refresh logic to reduce boilerplate.