Code Samples#

This page describes code samples that might be useful, either when learning Kotlin or figuring out a technique for your application.

If you use any code samples from here or elsewhere, make sure that you abide by our code policies and acknowledge your sources!

Course Repositories#

We maintain public repositories in GitLab. The following projects are available:

  • demos/*: full applications (console and desktop), with issue lists, documentation etc.
  • kotlin-language: Kotlin language examples. Used in lectures.
  • sample code: smaller, limited applications used to demonstrate specific functionality e.g., database connections, UI dialogs. Grouped into desktop/android folders based on platform.
  • templates: project documents e.g., meeting minute templates.

To get a copy, git clone the URL for the repository that you want to open. This command, for instance, would create a copy of the kotlin-language project in a directory of the same name.

$ git clone https://git.uwaterloo.ca/cs346/kotlin-language.git

The sample code folder contains code to accompany the lecture slides.

External Repositories#

This is a mix of tutorial links and code repositories.

Kotlin Code#

Kotlin Multiplatform Code#

Compose Code#

Cloud Computing#

Final Word#

XKCD Compiling
XKCD: Compiling