โ† All Android Development Flashcard Decks

Android Networking Flashcards

6 cards from real Android Development practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 Android Networking flashcards as text
  1. Which Retrofit annotation is used to pass a dynamic value in the URL path?

    Answer: @Path

    @Path replaces a named placeholder in the URL template with the value of the annotated parameter at runtime.

  2. What does OkHttp's connection pooling feature do?

    Answer: Reuses existing HTTP connections to reduce latency

    OkHttp's connection pool keeps HTTP connections alive and reuses them for subsequent requests, reducing the overhead of establishing new connections.

  3. Which Retrofit annotation adds a static header to every request of an API method?

    Answer: @Headers

    @Headers annotation adds one or more static header key-value pairs to the HTTP request made by the annotated method.

  4. What is the purpose of the ConnectivityManager in Android?

    Answer: To monitor and query the state of network connectivity

    ConnectivityManager provides information about network connectivity and allows apps to monitor changes in network state.

  5. Which HTTP method is used to update a resource partially in REST APIs?

    Answer: PATCH

    PATCH is used to apply partial modifications to a resource, while PUT replaces the entire resource.

  6. What does the @Query annotation do in Retrofit?

    Answer: Appends a query parameter to the URL

    @Query annotates a Retrofit method parameter to be appended as a URL query string parameter (e.g., ?key=value).