android-retrofit

Build Android network layers with Retrofit, coroutines, OkHttp, and Hilt.

Updated Dec 4, 2025
One-click install
npx skills add https://github.com/thinhtt264/Snaplet-App --skill android-retrofit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-retrofit
Source: https://github.com/thinhtt264/Snaplet-App/tree/main/.cursor/skills/android-retrofit
Command: npx skills add https://github.com/thinhtt264/Snaplet-App --skill android-retrofit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides Android developers in building robust type-safe HTTP clients with Retrofit, reducing boilerplate and runtime errors in network layers.

Core Features & Use Cases

  • Service definitions with Retrofit interfaces using Retrofit annotations for type-safe endpoints.
  • Coroutines support for suspending network calls and clean asynchronous code.
  • OkHttp integration with interceptors, logging, and sensible timeouts.
  • DI-ready configuration with Hilt or Dagger for scalable app architectures.

Quick Start

  • Create Retrofit service interfaces for your API.
  • Configure OkHttpClient with logging and timeouts.
  • Bootstrap Retrofit with a JSON converter and DI, then consume via suspend functions.

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 Retrofit network layer on Android?

To build a type-safe Retrofit network layer on Android, define Retrofit service interfaces with annotations for REST endpoints, configure OkHttpClient with timeouts and logging, and bootstrap Retrofit with a JSON converter to consume APIs safely.

Does Retrofit work with Kotlin coroutines for asynchronous network calls?

Retrofit works with Kotlin coroutines by defining suspend functions in your service interfaces, enabling clean asynchronous network calls. This approach integrates seamlessly with coroutine-based architecture for managing threading and concurrency.

Can I use Hilt for dependency injection in an Android Retrofit setup?

You can use Hilt for dependency injection in an Android Retrofit setup to provide a scalable app architecture. It bootstraps Retrofit and OkHttpClient instances, making your network layer DI-ready and easily testable.

How do I configure OkHttp interceptors and timeouts with Retrofit?

Configure OkHttp interceptors and timeouts by constructing an OkHttpClient instance with logging interceptors and sensible timeout values, then pass this client into your Retrofit builder to manage network requests and debugging.

What is the best way to handle dynamic URLs and query parameters in Retrofit?

The best way to handle dynamic URLs and query parameters in Retrofit is by applying specific Retrofit annotations to your service interface methods, ensuring type-safe endpoint definitions for flexible REST API consumption.

When should I use the repository pattern with Retrofit and Hilt?

Use the repository pattern with Retrofit and Hilt when building scalable Android apps that consume REST APIs. It separates data sourcing logic from UI, leveraging Hilt for DI and Retrofit suspend functions for network requests.