This handles the standard Retrofit setup you'll need for any modern Android app doing HTTP calls. It covers the practical stuff: dynamic URLs with path and query parameters, sending JSON bodies versus form data, header management both static and through interceptors, and proper Kotlin coroutines integration. The Hilt module example shows how to wire up OkHttp with logging and timeouts alongside kotlinx.serialization. The guidance on when to use Response<T> versus direct body types is actually useful, since that trips people up when they need to handle specific status codes. It assumes you're already sold on Retrofit and just want the current best practices without digging through Stack Overflow.

skills.sh installs
495
GitHub stars
1K
last updated
Aug 21, 2026

Install

$ npx -y skills add new-silvermoon/awesome-android-agent-skills --skill android-retrofit --agent claude-code

Installs into .claude/skills of the current project.

Files

Android Networking with Retrofit

Instructions

When implementing network layers using Retrofit, follow these modern Android best practices (2025).

1. URL Manipulation

Retrofit allows dynamic URL updates through replacement blocks and query parameters.

  • Dynamic Paths: Use {name} in the relative URL and @Path("name") in parameters.
  • Query Parameters: Use @Query("key") for individual parameters.
  • Complex Queries: Use @QueryMap Map<String, String> for dynamic sets of parameters.
interface SearchService {
    @GET("group/{id}/users")
    suspend fun groupList(
        @Path("id") groupId: Int,
        @Query("sort") sort: String?,
        @QueryMap options: Map<String, String> = emptyMap()
    ): List<User>
}

2. Request Body & Form Data

You can send objects as JSON bodies or use form-encoded/multipart formats.

  • @Body: Serializes an object using the configured converter (JSON).
  • @FormUrlEncoded: Sends data as application/x-www-form-urlencoded. Use @Field.
  • @Multipart: Sends data as multipart/form-data. Use @Part.

Sponsors

Details

Repository
github.com/new-silvermoon/awesome-android-agent-skills
Categories
AI & Agent Building, Mobile Development
First seen
Jun 3, 2026

More from new-silvermoon/awesome-android-agent-skills

All 17
1aj-geddes avatarcontainer-debuggingaj-geddes/useful-ai-promptsDebug Docker containers and containerized applications. Diagnose deployment issues, container lifecycle problems, and resource constraints.494skills.sh installs
2devanshudesai avatarexpo-liquid-glassdevanshudesai/agent-skillsDesign and implement beautiful, fluid Liquid Glass interfaces in Expo React Native apps. Covers four paths: (1) expo-glass-effect for UIKit-backed glass surface493skills.sh installs
3jwynia avatargame-facilitatorjwynia/agent-skillsNarrative RPG game master for collaborative storytelling. Use for tabletop RPG sessions, solo narrative games, or any real-time collaborative fiction requiring 493skills.sh installs
4rstackjs avatarrsbuild-v2-upgraderstackjs/agent-skillsUse when upgrading a Rsbuild 1.x project to v2, including dependency and configuration updates.493skills.sh installs
5sivaprasadreddy avatarspring-boot-skillsivaprasadreddy/sivalabs-agent-skillsBuild Spring Boot 4.x applications following the best practices. Use this skill: * When developing Spring Boot applications using Spring MVC, Spring Data JPA, S493skills.sh installs
6aj-geddes avataruser-persona-creationaj-geddes/useful-ai-promptsCreate detailed user personas based on research and data. Develop realistic representations of target users to guide product decisions and ensure user-centered 492skills.sh installs