What is Context in Android and which type should you use?
Context gives your code access to resources, services and storage. Learn the types of Context, which to use when, and how to avoid leaks.
47 posts about Android: questions with answers, tutorials and articles, newest first.
Context gives your code access to resources, services and storage. Learn the types of Context, which to use when, and how to avoid leaks.
Rotation destroys and recreates the activity by default. See what is lost, and how ViewModel and saved state keep your screen intact.
registerForActivityResult replaces startActivityForResult and request codes. Learn the migration, built-in contracts and how to write your own.
Compare Android and iPhone on price, software updates, ecosystem and customisation, and use a short checklist to pick the right phone.
Use intent extras for small values and Parcelable for objects. Learn the size limit, the API 33 change and the better options for large data.
An implicit intent describes an action and data, and Android picks the app that can handle it. See how matching works and how to use it safely.
Use an Android explicit intent to open another Activity, pass extras and Parcelable data and receive results with the Activity Result API.
An Activity is one screen of an Android app managed by the system. Learn how to create one, register it in the manifest and follow its lifecycle.
Learn Kotlin exception handling with try, catch, finally, throw, require, use and runCatching, including coroutine cancellation and Android tips.
See how by lazy defers initialisation, how its thread-safety modes differ and how delegated properties like observable and custom delegates work.
Kotlin generics explained with type parameters, upper bounds, in and out variance, type projections and reified types for Android developers.
Declare a Kotlin enum class, give constants properties and behaviour, and use them in exhaustive when expressions with entries and valueOf.
Sealed classes and interfaces restrict a hierarchy to known subtypes so when is exhaustive. See how to model UI state and results with them in Android.
Scope functions run a block on an object using this or it and return either the object or the result. Learn which of the five to pick and why.
Extension functions add behavior to existing classes without inheritance. See the syntax, Android examples, and the static dispatch rules that trip people up.
A higher-order function takes or returns another function. Learn function types, how to write your own, and how inline removes the cost of lambdas.
A Kotlin lambda is an anonymous function you can store, pass and return. Learn the syntax, the it shortcut, labeled returns and how closures capture variables.
Kotlin's map, filter and reduce replace manual loops with short, readable pipelines. See how each works, when to use fold, and when sequences help.
Understand Kotlin List, Set and Map, the difference between read-only and mutable collections, and the functions that transform them.
Kotlin classes are final by default. See how open, override, super and final override control inheritance, with runnable examples and common pitfalls.