Android Development (Kotlin) Tutorial
Learn Android Development (Kotlin) step by step: 104 lessons in 17 chapters with examples, quizzes, diagrams and projects.
Start learning →
of lessons completed
Getting Started
- What Is Android Development? Learn what Android development is: the OS layers, how apps differ from APIs, why Kotlin and Jetpack Compose are the modern default, and how this track teaches it.
- The Four Components and How Android Runs Your App Learn the four Android app components, how processes are created and ranked, which apps the system kills first, and the difference between cold, warm and hot starts.
- Android Versions, Boot Process, Zygote and Garbage Collection Understand how Android evolved and how it works inside: version and API level history, the system architecture, the boot sequence, Zygote and app start, the APK build tools and garbage collection.
- Jetpack, AndroidX and Kotlin versus Java on Android A map of Android Jetpack (Foundation, Architecture, Behavior, UI), how AndroidX replaced the Support Libraries, how to migrate, and how Kotlin compares with Java for Android development.
- Android Resources: res, raw, assets, Drawables and Densities Learn where files go in an Android project: res versus assets versus raw, drawable densities, vector assets and SVG import, shape and selector drawables, fonts, local HTML and Android Studio tips.
- Setting Up Android Studio Install Android Studio, use the SDK Manager, choose between an emulator and a real device, create an AVD and walk through the new-project wizard options step by step.
- Context in Android Understand Android's Context: Application vs Activity vs Service context, which one to use, how leaks happen, LocalContext in Compose, ContextWrapper and themed contexts.
- Anatomy of an Android Project Tour an Android Studio project: the app module, src/main, res folders, the manifest, build.gradle.kts, settings files and the generated R and BuildConfig classes.
- Gradle for Android Understand Android's Gradle setup: the Android Gradle Plugin, version catalogs, compileSdk, minSdk and targetSdk, build types, flavors and how dependencies are resolved.
- The Manifest and Resources Learn what AndroidManifest.xml declares, how intent filters work, and how strings, colors, dimens and qualifiers such as night, locale and density pick the right resource.
- Running, Debugging and Logcat Run an Android app, set breakpoints, filter Logcat by tag and log level, use the Layout Inspector and Compose previews, and fix the most common build errors.
- Kotlin on Android - KTX, Java Interop and Parcelize Learn Android KTX extensions, Kotlin vs Java on Android, @JvmStatic, @JvmOverloads, @JvmField, @JvmName, @Throws, nullability annotations, Java interop and @Parcelize.
Activities and the Lifecycle
- Activities and setContent Learn what an Android Activity is, how ComponentActivity and setContent put Compose on screen, what edge-to-edge means and why modern apps use one activity.
- The Activity Lifecycle Understand the Android Activity lifecycle: every callback from onCreate to onDestroy, visible versus focused, what belongs in each one and how process death works.
- Intents and Launching Other Screens Learn Android intents: explicit and implicit intents, extras, intent filters, the Activity Result API, and how to share content or open links safely.
- Broadcast Receivers Learn Android broadcast receivers: manifest vs context registration, system broadcasts, Android 8 limits, exported flags, goAsync, ordered broadcasts and Flow instead of LocalBroadcastManager.
- Configuration Changes and Saved State Why rotation recreates an Android activity, and how rememberSaveable, SavedStateHandle and onSaveInstanceState keep your state through rotation and process death.
- Runtime Permissions Learn Android runtime permissions: normal versus dangerous, the requestPermission contract, rationale and denial flows, and no-permission options like the photo picker.
Jetpack Compose Fundamentals
- Thinking in Compose Learn the Jetpack Compose mindset: declarative UI versus Views, the composition tree, why UI is made of functions, how setContent starts it and how previews work.
- Composable Functions Learn the rules of @Composable functions: naming, parameters, the modifier parameter, slots and trailing lambdas, emitting versus returning, and previews.
- Row, Column, Box and Arrangements Learn the three basic Compose layouts, how Arrangement and Alignment place children, how weight shares space, and how constraints flow down and sizes flow up.
- Modifiers Learn how Compose modifiers chain, why their order changes the result, the difference between padding and size, clickable areas, graphicsLayer and custom modifiers.
- Text, Images and Icons Learn to style Text in Compose, use fonts and AnnotatedString spans, load images and vector drawables, add icons, and write good content descriptions.
- Lazy Lists and Grids Learn LazyColumn, LazyRow and LazyVerticalGrid: items and keys, contentPadding, sticky headers, scroll state, and how lazy layouts compose only visible items.
State in Compose
- State and remember Learn what state is in Compose, how mutableStateOf triggers recomposition, why remember is needed, how by delegates work, and why plain variables fail.
- State Hoisting and Unidirectional Data Flow Learn state hoisting in Compose: stateless composables, the value plus onValueChange pattern, a single source of truth and unidirectional data flow.
- Recomposition and Stability Understand what triggers recomposition in Jetpack Compose, how skipping works, what stable types are, what strong skipping mode changes and how keys help.
- rememberSaveable, derivedStateOf and Collections Keep Compose state across rotation with rememberSaveable and custom Savers, avoid needless work with derivedStateOf, and use state-aware collections and snapshotFlow.
- Side Effects: LaunchedEffect, DisposableEffect and Friends Learn when and how to run side effects in Jetpack Compose: LaunchedEffect keys, rememberCoroutineScope, DisposableEffect cleanup, SideEffect, produceState.
Building a Real UI
- Material 3 and Theming Learn Material 3 in Compose: MaterialTheme, color schemes and roles, dynamic color, typography, shapes, dark theme and how design tokens keep UI consistent.
- Buttons, Text Fields and Forms Build interactive Compose forms: Material 3 button variants, TextField with keyboard options, IME actions and focus, validation state, checkboxes, switches and sliders.
- Scaffold, App Bars, Dialogs and Snackbars Build the frame of a Compose screen: Scaffold slots, TopAppBar, floating action button, SnackbarHost, AlertDialog and bottom sheets, plus how to handle one-off UI messages.
- Animation in Compose Learn Compose animation from the ground up: animate*AsState, AnimatedVisibility, updateTransition, animateContentSize, tween versus spring and gestures, with stand-ins.
- Adaptive Layouts and Window Size Classes Make your Android UI work on phones, tablets and foldables: WindowSizeClass, list-detail layouts, NavigationSuiteScaffold, insets and edge-to-edge, with runnable stand-ins.
- Views Interop and Legacy XML Read legacy XML layouts, use ViewBinding, embed Views with AndroidView and Compose with ComposeView, and migrate an old Android app to Compose one screen at a time.
- Date and Time Pickers in Compose Use Material 3 DatePicker, DatePickerDialog, TimePicker, TimeInput and DateRangePicker in Compose, and avoid the UTC milliseconds trap when converting to java.time.
- Tabs and Pagers in Compose Build swipeable tabs in Jetpack Compose with PrimaryTabRow, ScrollableTabRow and HorizontalPager, sync them through PagerState, add page indicators and set page sizes.
- Charts and Graphs on Android Draw pie, bar and line charts in Jetpack Compose with Canvas, scale data to pixels, choose a chart library such as Vico, and make charts accessible with text summaries.
- Gestures and Input Events in Compose Handle taps, long presses, drags, swipes, pinch-zoom, scrolling and keyboard focus in Jetpack Compose with clickable, pointerInput, draggable, transformable and nested scroll.
- WebView and Search Bars Embed web content with WebView in Jetpack Compose, handle navigation, back presses and the JavaScript bridge safely, and add Material 3 SearchBar or SearchView for search.
- Camera, Media Playback and Sharing Images Take photos with CameraX and the system camera, pick media with the photo picker, play video with Media3 in Compose, save to MediaStore and share through FileProvider.
- Google Maps in Android: Markers, Polylines and Distance Use Google Maps in an Android app: API key and SHA-1, the Maps SDK and Compose, markers, camera, polylines, map types, search, distance and live tracking, with runnable geometry stand-ins.
- Lottie, Shimmer and View Animations in Android Add motion to Android apps: Lottie JSON animations, shimmer loading placeholders in Compose and Views, ObjectAnimator, interpolators, fade and rotate effects, with runnable math stand-ins.
- Timers, Clocks, Sensors and Speech in Android Build time and device-feature screens on Android: CountDownTimer, Chronometer, stopwatch logic, analog and digital clocks, CalendarView, step counter and shake sensors, speech recognition and text to speech.
Legacy Views
- XML Layouts: LinearLayout, ConstraintLayout and More Learn the classic Android XML layouts: LinearLayout and layout_weight, FrameLayout, RelativeLayout, ConstraintLayout chains and guidelines, MotionLayout, and Compose equivalents.
- Classic Views and Widgets: TextView, EditText, Spinner and More Use the classic Android widgets: TextView, EditText and TextInputLayout, Button, Spinner, CheckBox, RadioGroup, Switch, SeekBar, RatingBar, ProgressBar and ImageView, with Compose equivalents.
- RecyclerView: Adapters, ViewHolders and DiffUtil Learn RecyclerView on Android: ViewHolder, Adapter, ListAdapter with DiffUtil, layout managers, click handling, multiple view types, ItemDecoration and swipe, versus LazyColumn.
- ListView, GridView, Spinner and Adapters (Legacy Views) Learn the classic Android adapter widgets: ListView, ArrayAdapter, BaseAdapter with convertView, GridView, Spinner, custom spinners and ExpandableListView, plus when to move to RecyclerView.
- More View Components: Toast, CardView, TableLayout, Autosizing Text and Nested Lists Fill the gaps of the XML view toolkit: custom Toast, CardView and expandable cards, ScrollView variants, TableLayout, autosizing TextView, ToggleButton, nested RecyclerView, scaling to screen sizes and ActionBar versus Toolbar.
- Fragments and the Fragment Lifecycle Learn Android Fragments: FragmentManager and transactions, fragment versus view lifecycle, viewLifecycleOwner, result API, shared ViewModel, ViewPager2 and Navigation, versus Compose.
- Menus, Toolbars, Drawers and Dialogs in the View System Build options, context and popup menus, MaterialToolbar, NavigationView with DrawerLayout, AlertDialog, DialogFragment, bottom sheets, TabLayout and Snackbar with Views, plus Compose equivalents.
Navigation
- Navigation Compose Basics Learn Navigation Compose: NavController, NavHost, type-safe routes with serializable destinations, navigate and popBackStack, plus a back stack simulator you can run.
- Passing Arguments and Results Pass typed arguments between Compose destinations, make some optional, return results to the previous screen, share ViewModels across destinations and know what never to pass.
- Back Stack, Launch Modes and Deep Links Control the Android back stack with popUpTo, launchSingleTop and saveState, understand activity launch modes, handle deep links and app links, and support predictive back.
- Bottom Navigation and Nested Graphs Build Android bottom navigation with one back stack per tab, group screens into nested navigation graphs, model auth flows and scope a ViewModel to a graph.
App Architecture
- Architecture Layers: UI, Domain and Data Learn the recommended Android app architecture: a UI layer, a data layer and an optional domain layer with use cases, plus separation of concerns and modularization basics.
- ViewModel Learn what an Android ViewModel survives and what it does not, how viewModelScope works, how to create ViewModels with factories and use SavedStateHandle correctly.
- UI State, Events and MVI-style Modelling Model Android screens with one UiState (loading, content, error), send user actions as events, handle one-off effects safely and use a reducer for predictable transitions.
- StateFlow and collectAsStateWithLifecycle Expose UI state from a ViewModel with StateFlow, share it with stateIn and WhileSubscribed, combine sources and collect safely in Compose with collectAsStateWithLifecycle.
- The Repository Pattern and Data Sources Learn the repository pattern in Android: a single source of truth, local and remote data sources, mappers between layers, caching strategies and fakes for testing.
- LiveData and Lifecycle-Aware Components Learn Android LiveData: MutableLiveData, observing with a lifecycle owner, MediatorLiveData, map and switchMap, DefaultLifecycleObserver, and how to migrate to StateFlow.
Coroutines and Background Work
- Coroutines on Android Use Kotlin coroutines on Android: Main, IO and Default dispatchers, viewModelScope and lifecycleScope, main-safe functions, cancellation on leaving a screen and error handling.
- Collecting Flows Safely Collect Kotlin Flows without wasting work or leaking: repeatOnLifecycle, flowWithLifecycle, callbackFlow, debounce for search and flatMapLatest explained.
- WorkManager Schedule reliable background work with WorkManager: workers, constraints, chained and periodic requests, expedited work, retries with backoff and observing status.
- Services, Notifications and Foreground Work Understand Android services (started and bound), foreground service types, notification channels, the POST_NOTIFICATIONS permission, alarms versus WorkManager and background limits.
- Threads, Handlers, Looper and Volley (Legacy) Understand the Android main thread, Thread and Executor, Handler, Looper and HandlerThread, runOnUiThread, AsyncTask's removal and Volley, and why coroutines replaced them.
Local Data
- Room Database Basics Learn Room, Android's SQLite library: entities, DAOs, the database class, queries, Flow results that update the UI, suspend inserts, conflict strategies and KSP setup.
- Room Relations and Migrations Model one-to-many and many-to-many data in Room, add indices and TypeConverters, export schemas and migrate databases safely between app versions.
- DataStore and Settings Store app settings with Jetpack DataStore: Preferences vs Proto, Flow-based reads, transactional writes and migrating from SharedPreferences.
- Files, Scoped Storage and Media Understand internal and external storage, scoped storage, MediaStore, the Storage Access Framework, cache directories and backup rules on Android.
- Paging 3 for Large Lists Load large lists in pages with Paging 3: PagingSource, Pager, LazyPagingItems, RemoteMediator, prefetch distance and load states explained.
- Content Providers and ContentResolver Learn Android content providers: content URIs, ContentResolver query and insert, MediaStore and Contacts, permissions, writing your own provider with UriMatcher, and FileProvider.
Networking
- Networking with Retrofit and OkHttp Call REST APIs from Android with Retrofit and OkHttp: interface definitions, suspend functions, interceptors, timeouts, base URLs and the Ktor alternative.
- JSON with kotlinx.serialization and Moshi Parse JSON on Android with kotlinx.serialization and Moshi: DTOs, unknown keys, nullable and default fields, converters and DTO to domain mapping.
- Error Handling and Offline-first Handle network failures in Android: sealed results, HTTP error mapping, retries with backoff, connectivity checks, Room as source of truth and syncing pending changes.
- Loading Images with Coil Load remote images in Jetpack Compose with Coil: AsyncImage, placeholders, memory and disk caches, sizing, transformations and the memory pitfalls to avoid.
- Firebase on Android: Auth, Firestore, Realtime Database and FCM Add Firebase to an Android app: BoM and google-services.json, email sign-in, Firestore versus Realtime Database, security rules, FCM push tokens and Crashlytics.
Dependency Injection
- Dependency Injection Concepts Understand dependency injection for Android: constructor injection, a manual app container, service locator trade-offs, scopes and how DI makes your code testable.
- Hilt Learn Hilt on Android: @HiltAndroidApp, @AndroidEntryPoint, @HiltViewModel, modules with @Provides and @Binds, qualifiers, scopes, assisted injection and Koin.
- Dagger 2 Fundamentals Learn Dagger 2: @Inject constructors, @Component, @Module with @Provides and @Binds, scopes, subcomponents and why Hilt wraps Dagger. Includes a hand-written component to run.
Testing
- Unit Testing ViewModels and Flows Test Android ViewModels with JUnit, runTest and test dispatchers: virtual time, Turbine-style flow assertions, fakes instead of mocks and a main dispatcher rule.
- Testing Compose UI Test Jetpack Compose screens with createComposeRule: the semantics tree, finders, assertions, actions, test tags, synchronization and a screenshot testing overview.
- Instrumented, Room and Navigation Tests Learn when to use androidTest instead of local tests, how to test Room with an in-memory database, assert the back stack with TestNavHostController, and run tests on CI.
Quality, Performance and Security
- Performance and Profiling Find and fix Android jank, startup and memory problems with Layout Inspector, Perfetto and the profiler, then speed up releases with R8, baseline profiles and macrobenchmarks.
- Securing Your App Secure an Android app: the app sandbox, exported components, network security config, Keystore, secrets in builds, WebView risks and Play Integrity, with runnable stand-ins.
- Accessibility and Localization Make your Android app usable with TalkBack and in every language: semantics, touch targets, contrast, string resources, plurals, RTL and per-app language settings.
- Dalvik, ART, DEX, Desugaring and Multidex How Kotlin code becomes an Android app: javac and kotlinc, D8 and R8, DEX files, ART's AOT, JIT and profile-guided compilation, desugaring, multidex and APK vs AAB.
Shipping to Users
- Signing and Release Builds Sign and ship an Android app: keystores, Play App Signing, App Bundles versus APKs, R8 mapping files, build variants, versionCode rules and safe secrets handling.
- Publishing on Google Play Publish on Google Play: developer account, store listing, data safety form, testing tracks, staged rollouts, policies, crash reporting and Android vitals explained step by step.
- Ads in Android Apps: AdMob and Other Networks Add ads to an Android app: AdMob banner, interstitial, rewarded and native formats, test IDs, consent, frequency capping, mediation and the Meta Audience Network, with runnable logic stand-ins.
- CI/CD for Android Automate Android builds with GitHub Actions: Gradle caching, lint and unit tests on every pull request, signed release bundles, internal-track uploads and automatic versioning.
- Binder, AIDL, Messenger and the NDK How Android apps talk across process boundaries with Binder, bound services, Messenger and AIDL, plus Parcelable, one-way calls and a first look at the NDK, JNI and CMake.
Projects
- Project: Notes App Build a notes app step by step: Room entity and DAO, repository, ViewModel with search, Compose list and editor screens, navigation, plus a runnable Kotlin logic layer.
- Project: To-do with Reminders Build a to-do app with settings in DataStore, reminders scheduled by WorkManager, notifications with permission handling and hoisted state, plus runnable Kotlin stand-ins.
- Project: Weather App Build a weather app: a Retrofit client, DTO mapping, a repository with a time-based cache, loading and error states, and the location permission flow, with runnable Kotlin stand-ins.
- Project: Expense Tracker Build an expense tracker: Room relations and SUM queries, money as cents, a pie and bar chart drawn on a Compose Canvas, a validated form and CSV export, with runnable Kotlin stand-ins.
- Project: News Reader with Paging Build a news reader with Paging 3 and a RemoteMediator for offline-first lists, Hilt for dependency injection and bottom navigation, with runnable Kotlin stand-ins for each part.
- Projects: Calculator, Paint App, Crypto Tracker, NFC Reader Four small Android projects in one lesson: a calculator, a Canvas paint app with undo, a crypto price tracker and an NFC tag reader, each with a runnable Kotlin stand-in.
- Project: Mini Games (Tic-Tac-Toe, Guess the Number, Reflex, Spin the Bottle, Magic 8 Ball) Build five small Android games with Compose: tic-tac-toe with a computer opponent, guess the number, a reflex tester, spin the bottle and a magic 8 ball, with the game logic tested in runnable Kotlin.
- Project: Utility Apps (Flashlight, Converter, Alarm, QR Scanner, Contacts, Media Player) Build useful single-purpose Android apps: a torch, a binary and decimal converter, an alarm setter, a QR code scanner, a contacts list, a photo viewer and a media player, with testable logic.
Practice and Review
- Practice: Compose and State Exercises Ten Jetpack Compose exercises with solutions on state hoisting, lists, keys, derived state and side effects, each with a runnable Kotlin stand-in you can change.
- Practice: Architecture, Navigation and Data Exercises Ten Android exercises with solutions on layers, ViewModel, UI state, StateFlow, the back stack, tabs and offline-first repositories, with runnable Kotlin stand-ins.
- Android Interview Questions Forty-seven Android interview questions with concise answers on lifecycle, Compose, Views, fragments, coroutines, Room, architecture and performance, plus runnable stand-ins.
- Android Cheat Sheet A one-page Android reference: lifecycle table, Compose essentials, state APIs, Gradle snippets, adb and Logcat commands and an architecture checklist, with runnable models.