This repository hosts the coding exercises from a Kotlin Workshop for Android. Basic knowledge of both Android and Java is assumed for anyone participating in this workshop. No prior knowledge of Kotlin is required; the linked presentations, videos, and workbook start from very basic syntax in Kotlin and build from there.
The linked presentations and videos are from a recording of a live event held internally at Yelp on May 24th, 2018, and may already be out of date. If a new event is held, this repository and its recordings may be updated. Otherwise, any updates are rather unlikely.
Format of this Repository
There are a total of 7 apps in this repository. If you follow along with the workshop, you can start
from the folder app
and build your Android app by following the instructions in the video and
workbook. If you struggle to complete an exercise, you can simply look in the folder with the
corresponding number. For example, app4
contains the Android app that is the result of completing
exercises 1-4. Alternatively, if you’re interested in completing, for example, only sessions 3 and
6, you can start from app2
to complete the exercises in session 3, and then start from app5
to
complete the exercises in session 6.
Format of the Workshop
The workshop was intended as a one-day event. It was split into sessions of about 1 hour each. Each session roughly consisted of a 20-minute presentation, followed by a 20-minute live coding session, and finally, a 20-minute attendee coding session on a topic relevant to the presentation. Presenters were available during the coding sessions to answer questions or troubleshoot any issues. By the end of the day, we built a simple app that displayed a list of businesses using Yelp's public API.
Here’s a workbook with more detailed information on the topic, and below is a list of all sessions and a brief summary of their content.
Syllabus
-
Basic Syntax and Types - how to create classes, interfaces, and functions. At the end you should be able to write a very simple Kotlin class (presentation, video)
-
Constructors and Control Flow - difference between statements and expressions, conditional statements and loops, jumps and qualifiers, primary and secondary constructors, and execution flow when constructing instances (presentation, video)
-
Functions - operators, inlining, a little bit about generics, named parameters, lambdas and closures, obtaining references to functions and passing them to other functions, and higher-order functions (presentation, video)
-
Properties and Nullability - Java interop, synthetic and delegated properties, custom setters and getters,
lateinit
, nullable and non-null properties, and optional invocation (presentation, video) -
Useful Kotlin Standard Functions - introduction to
use
,let
,apply
,also
,with
,isEmpty
,orEmpty
, and more, as well as how and when to use them (presentation, video) -
Kotlin's Collections APIs - mapping, transforming, filtering, aggregating, and associating anything you can iterate over like a boss (presentation, video)
-
How to Build DSLs - what they’re useful for and how to build them (presentation, video)
Licenses
This Kotlin Workshop exercise repository is licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
The Kotlin Workshop presentations, videos and other written materials are licensed under the Creative Commons, Attribute, No Derivatives, Version 3.0 US: https://creativecommons.org/licenses/by-nd/3.0/us/legalcode