Advanced Android Networking
OkHttp Interceptors, Authentication, Cache, Certificate Pinning, WebSocket, GraphQL with Apollo Client
1What is an Interceptor in OkHttp?
What is an Interceptor in OkHttp?
Câu trả lời
An Interceptor is a powerful OkHttp mechanism that allows intercepting, observing and modifying HTTP requests and responses. It executes between the application and the network, allowing adding headers, logging, handling authentication, etc.
2How do you add an Interceptor to an OkHttpClient?
How do you add an Interceptor to an OkHttpClient?
Câu trả lời
Use the OkHttpClient builder with the addInterceptor() method for application interceptors or addNetworkInterceptor() for network interceptors. Interceptors are executed in the order they are added.
3What is a Logging Interceptor used for?
What is a Logging Interceptor used for?
Câu trả lời
The Logging Interceptor (HttpLoggingInterceptor) allows logging all HTTP requests and responses for debugging. You can configure the log level: NONE, BASIC (request line), HEADERS (with headers), BODY (with full body).
How do you create an Authentication Interceptor to add a Bearer token?
How do you add a custom header to all requests with an Interceptor?
+10 câu hỏi phỏng vấn
Các chủ đề phỏng vấn Android khác
Android Fundamentals
Android UI and Resources
Android Lifecycle
Android Navigation
Android Data Management
Android Networking
Android Testing
Android Gradle
Kotlin Language Essentials for Android
Room Database
Background Work
Jetpack Compose
Permissions and Device Features
Firebase for Android
Android MVVM Architecture
Kotlin Collections and Operators
Kotlin Coroutines and Flow
Android Dependency Injection
Android MVI Architecture
Android Clean Architecture
Android Compose Advanced
Android Performance and Monitoring
Android Security and Privacy
Android CI/CD and Release
Android UX and Form Factors
Android Testing Advanced
Nắm vững Android cho lần phỏng vấn tiếp theo
Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.
Bắt đầu miễn phí