A realistic Android interview practice app built with modern Jetpack libraries — designed to sharpen your architecture and UI skills.
- Fetch posts from a public REST API (JSONPlaceholder)
- Display a paginated list with integrated search and filtering
- Navigate to details screens for individual items
- Work offline with Room database and a RemoteMediator for caching & sync
- Preserve state safely across configuration changes using
ViewModelandSavedStateHandle
Requirements
- Android Studio Hedgehog or newer (JDK 17)
- Android SDK 26+
Run
- Open the project in Android Studio.
- Sync Gradle.
- Run the
appconfiguration on an emulator or device.
Network: The app uses
https://jsonplaceholder.typicode.com/and does not require keys.
- Kotlin, Coroutines/Flow
- Jetpack Compose + Material 3 + Navigation
- Hilt for Dependency Injection
- Retrofit + OkHttp + Kotlinx Serialization for networking/JSON
- Room for local cache
- Paging 3 with RemoteMediator (offline-first)
- MVVM + Repository
- UI (Compose) observes
StateFlowfrom ViewModels - Repository coordinates network ↔ database
RemoteMediatorhandles sync/pagination between server and Room
UI (Compose) ──observes──▶ ViewModel ──calls──▶ Repository ──▶ Retrofit (API)
│
└──▶ Room (Local cache)
app/
src/main/java/<your.package>/
app/ # App-wide bootstrapping (Application, DI)
common/ # Result wrappers, utils, constants
data/ # remote/ (Retrofit), local/ (Room), paging/, repository/
domain/ # models/, usecases/ (optional)
presentation/ # ui/, screens/, components/, nav/
ui/theme/ # Theme (colors/typography)
Minimal example:
@AndroidEntryPoint
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
InterviewTheme {
AppNavGraph() // startDestination = Home
}
}
}
}- Search with
debounce+flatMapLatest - Paging list (append/loading states, error/retry)
- Offline‑first (airplane mode after first load)
- Safe state on rotation (SavedStateHandle)
- Clean layering & DI
- Unit: Repository + ViewModel (fake API/DAO,
kotlinx-coroutines-test) - UI: Compose tests for the list & details render
- Build fails JDK: Ensure Gradle JVM is set to 17 (
File → Settings → Build Tools → Gradle). - No internet: Check emulator has network or try on device.
- Room schema change: For quick iteration, use
fallbackToDestructiveMigration()(already enabled in sample) but avoid for production.
- Add
RetryUI for network errors - Replace details workaround with
DAO.getById(id) - Add UI & unit tests
- Real server paging; remove client‑side slicing
- CI (GitHub Actions) for build & lint
MIT