โ—† Sparround

Networking & data

0%

Retrofit/OkHttp in depth, serialization choices, Room, caching strategies and background work with WorkManager.

๐ŸŽฏ Stage assignment

Stage project โ€” "an offline-first transaction feed" (4-5 hours).

Complete the previous stage's screen with a real data layer:

  • Retrofit + OkHttp: an auth interceptor, logging (debug only), timeouts. Use a free API (httpbin, JSONPlaceholder) or a local mock server.
  • Map errors into a sealed interface result โ€” no try/catch left in the ViewModel.
  • Room: a transactions table, a Flow-returning DAO, the DB as single source of truth.
  • refresh() fetches into the DB; the UI reads only the DB. Test it in airplane mode.
  • A "last updated" indicator + a WorkManager job that refreshes when connectivity returns.

Done when: the list still appears after restarting with the network off, and refreshes itself once it is back.