android-retrofit

Build type-safe Android REST clients with Retrofit and Kotlin coroutines.

Updated Nov 3, 2025
One-click install
npx skills add https://github.com/devanfer02/telnetquiz --skill android-retrofit-devanfer02
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-retrofit
Source: https://github.com/devanfer02/telnetquiz/tree/main/.claude/skills/android-retrofit
Command: npx skills add https://github.com/devanfer02/telnetquiz --skill android-retrofit-devanfer02

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines building Android network layers with Retrofit by providing a clear, type-safe setup that reduces boilerplate and prevents common mistakes when consuming REST APIs.

Core Features & Use Cases

  • Type-safe API definitions with Retrofit interfaces and Kotlin coroutines.
  • Flexible request bodies, form data, and multipart uploads.
  • Header management and authentication strategies (static/dynamic headers, interceptors).
  • Response handling and error management with direct body vs Response<T>.
  • DI-ready Retrofit setup using Hilt/Dagger.
  • Common use cases: fetching data, posting JSON, uploading files, and handling authenticated endpoints.

Quick Start

Add Retrofit, OkHttp, and Kotlin JSON (or Moshi) to your app dependencies, configure a singleton Retrofit instance in your DI module, define a service interface with @GET/@POST etc., and inject it where needed.

Frequently Asked Questions about android-retrofit

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

FAQPage Schema
How do I set up a type-safe REST client with Retrofit and Kotlin coroutines?

To set up a type-safe REST client with Retrofit, define a service interface with @GET or @POST annotations, configure a singleton Retrofit instance with OkHttp, and inject it using Hilt to execute network calls with Kotlin coroutines.

What's the best way to handle Retrofit authentication and headers in Android?

The best way to handle Retrofit authentication is by using static or dynamic headers within your service interface definitions, or by attaching OkHttp interceptors to manage authentication tokens dynamically across requests.

How do I upload files and post JSON using Retrofit on Android?

You can upload files and post JSON using Retrofit by utilizing flexible request bodies, form data, and multipart uploads within your API interface definitions to transmit data to your REST endpoints.

Does this Retrofit setup support dependency injection with Hilt?

Yes, this Retrofit setup is DI-ready and fully supports dependency injection with Hilt, allowing you to configure and provide singleton Retrofit instances directly into your Android app components.

How do I handle API errors when using Retrofit with Kotlin coroutines?

Handling API errors with Retrofit involves distinguishing between direct body responses and wrapped Response<T> objects, allowing you to manage error states and response handling logic effectively.