Skip to content

Mobile & Android

Android libraries, Flutter, Kotlin and Swift. 80 posts, newest first. All topics

  1. Mobile & AndroidLast Light Outpost: a Godot zombie base-defense game for Android and the browserLast Light Outpost is a top-down zombie base-defense game in Godot 4.7: its wave rules, code-drawn art, twin-stick touch controls and the Android build on Google Play.
  2. Mobile & AndroidMeridian: an offline tasks, habits and focus app for Android and the webHow Meridian works: one JSON document in localStorage, a quick-add parser, forgiving habit scores, AES-GCM locked notes and a Capacitor build for Google Play.
  3. Mobile & AndroidAfterlight on Android: touch controls and a Capacitor shell for a keyboard JRPGPorting the three.js JRPG Afterlight to Android: on-screen controls that press the same actions as the keyboard, a scaled desktop layout, and a signed Play bundle.
  4. Mobile & AndroidStateFlow and SharedFlow in Kotlin for Android UI stateHot and cold flows, StateFlow for screen state, SharedFlow for one-off events, stateIn with WhileSubscribed(5000), repeatOnLifecycle, and testing with runTest.
  5. Mobile & AndroidState Management in Flutter with Riverpod 3Riverpod 3 for Flutter apps: providers, ConsumerWidget, ref.watch versus ref.read, Notifier and AsyncNotifier, optional code generation, and tests with ProviderContainer.
  6. Mobile & AndroidSwiftUI's @Observable Macro: Moving Off ObservableObjectHow the Observation framework changes SwiftUI state: @Observable instead of ObservableObject and @Published, @State for owned models, @Bindable and typed @Environment.
  7. Mobile & AndroidState in Jetpack Compose: remember, State Hoisting and ViewModelHow state works in Jetpack Compose: remember and rememberSaveable, stateless composables, state hoisting, and a ViewModel StateFlow collected with lifecycle awareness.
  8. Mobile & AndroidAndroid Room basics: entities, DAOs and a database in KotlinHow to set up Android's Room library with KSP, define an entity, DAO and database, and read and write data from an Activity with coroutines and Flow.
  9. Mobile & AndroidButterKnife on Android: binding views and click listeners, and migrating to View BindingHow ButterKnife's @BindView and @OnClick annotations work, the setup gotchas on current Android Gradle Plugin versions, and the View Binding code that replaces them.
  10. Mobile & AndroidPublishing a Swift package: SwiftPM, Git tags and the Swift Package IndexCreate a Swift package with SwiftPM, tag a semantic version, push it to a public Git repository, and list it on the Swift Package Index so others can depend on it.
  11. Mobile & AndroidSwift closures: syntax, capturing values, escaping and autoclosuresHow Swift closures work: the short syntax forms, trailing closures, how values are captured, @escaping, retain cycles with [weak self], and @autoclosure.
  12. Mobile & AndroidAccess control in Swift: private, fileprivate, internal, package, public and openSwift's six access levels (private, fileprivate, internal, package, public, open), what each one allows, and the defaults and rules that trip people up.
  13. Mobile & AndroidAdding a Google Map with a marker to an Android appSet up a Maps SDK for Android API key, add the play-services-maps dependency, and show a map with a marker using SupportMapFragment in Java.
  14. Mobile & AndroidSwift memory management: ARC, reference cycles and exclusive accessHow Automatic Reference Counting frees Swift class instances, how to break reference cycles with weak and unowned, and what exclusive access and actors protect against.
  15. Mobile & AndroidUsing Alamofire, RxSwift and SwiftyJSON in a Swift projectHow to add Alamofire, RxSwift and SwiftyJSON with Swift Package Manager, with a working example of each and when Apple's built-in APIs are the better choice.
  16. Mobile & AndroidType casting in Swift: is, as, as? and as!How Swift's is, as, as? and as! operators work: upcasting, conditional and forced downcasting, casting in switch statements, and casting from Any and to protocols.
  17. Mobile & AndroidMixing Swift and Objective-C: bridging headers and the generated Swift headerHow to call Objective-C from Swift with a bridging header, call Swift from Objective-C through the generated -Swift.h header, and how types bridge.
  18. Mobile & AndroidCreating, testing and publishing a Swift package with SwiftPMCreate a Swift library with swift package init, understand the Package.swift manifest, add a dependency, build and test it, and publish versions with Git tags.
  19. Mobile & AndroidAbstract classes vs interfaces in KotlinHow abstract classes and interfaces work in Kotlin, when to use each, and how open, override and super fit together.
  20. Mobile & AndroidKotlin OOP basics: classes, properties, constructors, inheritance and polymorphismKotlin classes and objects, companion objects, properties and backing fields, primary and secondary constructors, inheritance with open, and polymorphism.
  21. Mobile & AndroidReflection and annotations in Kotlin: reading properties and custom annotationsHow to inspect a class at runtime with Java reflection and kotlin-reflect, and how to declare, apply and read your own annotations in Kotlin.
  22. Mobile & AndroidDart functions on Appwrite: base64 encode, HTTPS check and email slicerThree small Dart functions (base64 encoder, HTTPS URL check, email slicer) and how to run them as Appwrite Functions with the current context API.
  23. Mobile & AndroidSwift concurrency basics: async/await, actors, task groups and cancellationSwift concurrency with working examples of async/await, actors, task groups, and cancellation, including a timeout helper and common gotchas.
  24. Mobile & AndroidEspresso UI tests on Android: setup, matchers, idling resources and intentsHow to set up Espresso with AndroidX Test, write a UI test with ActivityScenarioRule, handle background work with idling resources, and verify intents.
  25. Mobile & AndroidSwift package conventions: layout, access control, tests and versioningPractical conventions for Swift packages: naming, layout, access control including package, DocC comments, tests, semantic versioning and a clean Package.swift.
  26. Mobile & AndroidRxJava 3 on Android: observables, operators and threadingHow RxJava 3 models async work on Android: Observable, Single and friends, common operators, schedulers, Retrofit integration, and disposing subscriptions.
  27. Mobile & AndroidGoogle Analytics on Android: the legacy v4 SDK and moving to FirebaseWhat Google Analytics v4 SDK code for Android looks like, why it no longer works, and how to replace trackers and hits with Google Analytics for Firebase.
  28. Mobile & AndroidMockito for Android unit tests: mocks, stubbing, and verificationUse Mockito 5 in Android unit tests: create mocks, stub return values, verify calls, use argument matchers and answers, and mock final classes.
  29. Mobile & AndroidRetrofit on Android: calling a REST API from JavaSet up Retrofit in an Android app, define an API interface, make an async call with enqueue, and share one OkHttpClient for caching, auth headers and pooling.
  30. Mobile & AndroidDagger 2 on Android: components, modules, scopes and a working setupHow Dagger's components, modules, @Inject constructors and scopes fit together, with a working Java example for an Android app and when to use Hilt instead.
  31. Mobile & AndroidSwift standard library basics: numbers, strings, collections and algorithmsA tour of Swift's standard library: integer and floating-point types, String and Character, Array, Set and Dictionary, and sorted, filter, map and reduce.
  32. Mobile & AndroidBuilding a Chrome extension in Flutter to view my ChatGPT promptsA Flutter web app packaged as a Manifest V3 Chrome extension popup that fetches a markdown file of ChatGPT prompts from GitHub and renders it.
  33. Mobile & AndroidFirebase Realtime Database on Android: setup, reads, writes and security rulesAdd Firebase Realtime Database to an Android app with the Firebase BoM, write and listen for data in Java, enable offline persistence, and lock it down with rules.
  34. Mobile & AndroidPlaces SDK for Android: nearby search, place details, autocomplete, and photosSet up the Places SDK for Android with Places API (New), then run a nearby search, fetch place details, show autocomplete predictions, and load place photos in Java.
  35. Mobile & AndroidSwift for mobile apps: strengths, drawbacks and when to pick something elseThe practical pros and cons of Swift for mobile development: safety, Apple tooling, Objective-C interop, Android support, and language churn.
  36. Mobile & AndroidSwift enums: cases, associated values, raw values, and switchHow Swift enums work, covering basic cases, associated values, raw values, switch pattern matching, CaseIterable, and adding methods to an enum.
  37. Mobile & AndroidThe Android Support Library: what it did and how to move to AndroidXWhat the Android Support Library provided, how its artifacts map to AndroidX and Material Components, and how to migrate an old project off android.support.
  38. Mobile & AndroidWhere Swift is heading: concurrency, server-side Swift and new platformsWhere Swift is heading beyond iOS: compile-time data-race safety, server-side frameworks, Linux, Windows, Android and WebAssembly SDKs, and what happened to Swift for TensorFlow.
  39. Mobile & AndroidContributing to an open-source Swift package: fork, test and open a pull requestFind a Swift package to work on, fork and clone it, build and test with SwiftPM or Xcode, and open a pull request that maintainers can review quickly.
  40. Mobile & AndroidJetpack Navigation for fragments: nav graphs, Safe Args, and deep linksSet up the Jetpack Navigation component in a fragment-based Android app: a navigation graph, a NavHostFragment, type-safe arguments with Safe Args, and deep links.
  41. Mobile & AndroidUnit testing in Swift with XCTest and Swift TestingSet up a test target in Xcode, write unit tests with XCTest assertions, run them, and see the same tests written with the newer Swift Testing framework.
  42. Mobile & AndroidBuilding a first iOS app in Xcode with Swift and storyboardsCreate an iOS app project in Xcode, find your way around the workspace, connect a storyboard button and label to Swift code, then run and debug it.
  43. Mobile & AndroidSwift error handling: throws, do-catch, try?, typed throws and rethrowsHow Swift error handling works: defining Error types, throwing and propagating errors, do-catch with patterns, try? and try!, typed throws, rethrows and defer.
  44. Mobile & AndroidLoading images on Android with Glide: setup, placeholders, transformations and cachingHow to add Glide to an Android project, load images into an ImageView with placeholders, apply built-in and custom transformations, and control caching.
  45. Mobile & AndroidSwift performance tips: build settings, dispatch, copy-on-write and inliningSwift performance tips that hold up: build with -O and whole-module optimization, cut dynamic dispatch, use copy-on-write and inout well, and measure first.
  46. Mobile & AndroidScraping Steam's top sellers with Dart and beautiful_soup_dartFetch Steam's top sellers search page with the http package, parse it with beautiful_soup_dart, and serve the results from an Alfred endpoint.
  47. Mobile & AndroidThe Android framework APIs: core packages and app componentsA map of the Android framework's core android.* packages and the four app components (activities, services, content providers, broadcast receivers), with current caveats.
  48. Mobile & AndroidFunctional programming in Swift with closures, map/filter/reduce, and value typesFunctional programming in Swift with closures, map/filter/reduce, function types, value-type immutability, pattern matching, and recursion, with runnable examples.
  49. Mobile & AndroidWrapping the Open Food Facts API with an Alfred server in DartA small Dart backend built with Alfred that turns query-string parameters into an Open Food Facts product search and returns the results as JSON.
  50. Mobile & AndroidSwift generics: generic functions, generic types and constraintsHow to write generic functions and types in Swift, constrain them with protocols and where clauses, and what generics cost at runtime.
  51. Mobile & AndroidSwift extensions: adding methods, properties and protocol conformances to existing typesHow Swift extensions add methods, computed properties, initializers and protocol conformances to existing types, plus what they can't do.
  52. Mobile & AndroidHow I deployed a Dart Alfred server to a Hugging Face Docker SpaceCompiling a Dart Alfred HTTP server to a native executable and running it on a Hugging Face Docker Space with a multi-stage Dockerfile.
  53. Mobile & AndroidPicasso on Android: loading, resizing, and transforming imagesLoad images into Android ImageViews with Square's Picasso: placeholders, resizing, and custom transformations, plus the Coil equivalent now that Picasso is deprecated.
  54. Mobile & AndroidOkHttp on Android: making requests and adding interceptorsAdd OkHttp 5 to an Android app, make an asynchronous GET request without leaking responses, and write an interceptor for logging or auth headers.
  55. Mobile & AndroidSwift Package Manager basics: creating a package and managing dependenciesCreate a Swift package from the command line, add a dependency such as Alamofire to Package.swift, and update, pin or remove dependencies with SwiftPM.
  56. Mobile & AndroidAndroid Architecture Components: ViewModel, LiveData, Room, WorkManager and Navigation in KotlinA short Kotlin example for each of the main Jetpack architecture libraries (ViewModel, LiveData, Room, Data Binding, WorkManager, Navigation) and the gotchas in each.
  57. Mobile & AndroidMaterial Components for Android: themes and common widgets in XML layoutsSet up Material Components for Android (Views) with a Material 3 theme, then use buttons, text fields, cards, app bars, navigation views, and snackbars.
  58. Mobile & AndroidDebugging Swift in Xcode: breakpoints, LLDB, logging and sanitizersHow to debug Swift code in Xcode with breakpoints, LLDB's p, po and v commands, print and Logger output, and the Address and Thread Sanitizers.
  59. Mobile & AndroidSwift basics: variables, types, control flow and functionsSwift basics for newcomers: let and var, type inference, the core value types, optionals, if, switch, loops and functions with argument labels.
  60. Mobile & AndroidBuilding a Flutter Pokédex, part II: the Pokémon details screenThe details screen of my Flutter Pokédex: loading a Pokémon from bundled JSON and PokeAPI, then showing its description, abilities, size and a base-stat chart.
  61. Mobile & AndroidGenerating a PDF resume in Dart with the pdf packageBuild a one-page resume PDF from Dart code with the pdf package, covering a centred header, two-column job and education rows, bullet points and skill tags.
  62. Mobile & AndroidSwift operators: arithmetic, bitwise, ranges and custom operatorsSwift's arithmetic, comparison, logical, bitwise, range and assignment operators, the overflow and nil-coalescing operators, and how to define a custom operator.
  63. Mobile & AndroidBuilding a Flutter Pokédex, part I: Figma, DhiWise and an infinite-scroll gridStarting a Flutter Pokédex from a Figma design and DhiWise-generated code, then building a lazily loading Pokémon grid and type-coloured cards.
  64. Mobile & AndroidSwift optionals: if let, guard let, optional chaining and ??How Swift optionals represent missing values, and how to unwrap them safely with if let, guard let, optional chaining, the ?? operator and map.
  65. Mobile & AndroidSwift protocols: requirements, extensions, associated types and compositionHow to define and adopt Swift protocols, add default implementations with extensions, use associated types, inheritance and composition, and choose between some and any.
  66. Mobile & AndroidScraping Pokémon data and images for a Pokédex with PythonA Python script that pulls every Pokémon's name, ID and types from PokeAPI's GraphQL API, then finds an image for each one through Bulbapedia's MediaWiki API.
  67. Mobile & AndroidParsing JSON with Klaxon in Kotlin: data classes, arrays and the json DSLUse the Klaxon library to parse JSON into Kotlin data classes, parse JSON arrays into lists, and build JSON with Klaxon's json DSL.
  68. Mobile & AndroidRxKotlin basics: creating, transforming and combining ObservablesSet up RxKotlin 3 with RxJava 3, create Observables, use map, filter, merge and zip, handle errors, and move work between threads with schedulers.
  69. Mobile & AndroidKAndroid Kotlin extensions for Android, and what replaces them todayWhat the KAndroid library offers (text watchers, toasts, intents, threading and logging helpers), how to add it with JitPack, and the AndroidX equivalents.
  70. Mobile & AndroidAnko for Android: Kotlin layout DSL, intents and dialogs (deprecated)How JetBrains' Anko built Android layouts, intents and dialogs in Kotlin code, why it's deprecated, and the Jetpack Compose equivalent.
  71. Mobile & AndroidGetting started with Flutter: create and run your first appWhat Flutter is, how its widget model works, and how to create, run and edit a first Flutter app with hot reload.
  72. Mobile & AndroidSide hustle income tracker in Flutter: SQLite storage and CSV exportA small Flutter app that records side hustle income in SQLite with sqflite, lists and deletes entries, and exports everything to a CSV file.
  73. Mobile & AndroidWriting a linear congruential generator (and a Rational class) in DartA linear congruential generator and a simplified-fraction Rational class in Dart 3, ported from my dart-basic-math-lib, with the gotchas around overflow and seeding.
  74. Mobile & AndroidFlutter todo list with SupabaseA small Flutter todo app backed by a Supabase table, covering listing, adding, completing and deleting todos with the supabase Dart client.
  75. Mobile & AndroidIntermittent build failures on react native android due to jcenterHow I migrate from jcenter to mavenCentral using patch files.
  76. Mobile & AndroidBasic React Native Templatereact native template for a basic app
  77. Mobile & AndroidTrump Quotes app for flutterRecently i was updating my flutter quotes trump app to use the latest version of flutter, here are some of the lessons i learned.
  78. Mobile & AndroidFlutter Remove background from image web app Part IIIAutomatical update app using fastlane
  79. Mobile & AndroidFlutter Remove background from image web app Part IIWIP web app that allows the user to download an image after the remove.bg api has been applied.
  80. Mobile & AndroidFlutter Remove background from image web app Part IWeb app / mobile app that allows the user to download an image after the remove.bg api has been applied.

© 2026 David Li · Home · Blog · RSS ·Classic site · Built with Astro, Starlight and three.js · Logos:Font Awesome Free (CC BY 4.0)