Expert checklist and prompts for auditing and fixing Android accessibility issues, especially in Jetpack Compose.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Expert guidance on setting up and using Retrofit for type-safe HTTP networking in Android. Covers service definitions, coroutines, OkHttp configuration, and Hilt integration.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치 방법 보기설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
When implementing network layers using Retrofit, follow these modern Android best practices (2025).
Retrofit allows dynamic URL updates through replacement blocks and query parameters.
{name} in the relative URL and @Path("name") in parameters.@Query("key") for individual parameters.@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>
}
You can send objects as JSON bodies or use form-encoded/multipart formats.
application/x-www-form-urlencoded. Use @Field.multipart/form-data. Use @Part.interface UserService {
@POST("users/new")
suspend fun createUser(@Body user: User): User
@FormUrlEncoded
@POST("user/edit")
suspend fun updateUser(
@Field("first_name") first: String,
@Field("last_name") last: String
): User
@Multipart
@PUT("user/photo")
suspend fun uploadPhoto(
@Part("description") description: RequestBody,
@Part photo: MultipartBody.Part
): User
}
Headers can be set statically for a method or dynamically via parameters.
@Headers.@Header.@HeaderMap.interface WidgetService {
@Headers("Cache-Control: max-age=640000")
@GET("widget/list")
suspend fun widgetList(): List<Widget>
@GET("user")
suspend fun getUser(@Header("Authorization") token: String): User
}
When using suspend functions, you have two choices for return types:
User): Returns the deserialized body. Throws HttpException for non-2xx responses.Response<User>: Provides access to the status code, headers, and error body. Does NOT throw on non-2xx results.@GET("users")
suspend fun getUsers(): List<User> // Throws on error
@GET("users")
suspend fun getUsersResponse(): Response<List<User>> // Manual check
Provide your Retrofit instances as singletons in a Hilt module.
@Module
@InstallIn(SingletonComponent::class)
object NetworkModule {
@Provides
@Singleton
fun provideJson(): Json = Json {
ignoreUnknownKeys = true
coerceInputValues = true
}
@Provides
@Singleton
fun provideOkHttpClient(): OkHttpClient = OkHttpClient.Builder()
.addInterceptor(HttpLoggingInterceptor().apply { level = HttpLoggingInterceptor.Level.BODY })
.connectTimeout(30, TimeUnit.SECONDS)
.build()
@Provides
@Singleton
fun provideRetrofit(okHttpClient: OkHttpClient, json: Json): Retrofit = Retrofit.Builder()
.baseUrl("https://api.github.com/")
.client(okHttpClient)
.addConverterFactory(json.asConverterFactory("application/json".toMediaType()))
.build()
}
Always handle network exceptions in the Repository layer to keep the UI state clean.
class GitHubRepository @Inject constructor(private val service: GitHubService) {
suspend fun getRepos(username: String): Result<List<Repo>> = runCatching {
// Direct body call throws HttpException on 4xx/5xx
service.listRepos(username)
}.onFailure { exception ->
// Handle specific exceptions like UnknownHostException or SocketTimeoutException
}
}
suspend functions for all network calls.Response<T> if you need to handle specific status codes (e.g., 401 Unauthorized).@Path and @Query instead of manual string concatenation for URLs.OkHttpClient with logging (for debug) and sensible timeouts.아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
Expert checklist and prompts for auditing and fixing Android accessibility issues, especially in Jetpack Compose.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Expert guidance on setting up and maintaining a modern Android application architecture using Clean Architecture and Hilt. Use this when asked about project structure, module setup, or dependency injection.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Authoritative rules and patterns for production-quality Kotlin Coroutines onto Android. Covers structured concurrency, lifecycle integration, and reactive streams.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Guidance on implementing the Data Layer using Repository pattern, Room (Local), and Retrofit (Remote) with offline-first synchronization.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Production-ready scripts for Android app testing, building, and automation. Provides semantic UI navigation, build automation, log monitoring, and emulator lifecycle management. Optimized for AI agents with minimal token output.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Expert guidance on setting up scalable Gradle build logic using Convention Plugins and Version Catalogs.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.