Make a Timer App: Countdown Timer (Ep 2) – Android Kotlin Tutorial (Code)

Learn how to create a beautiful material design timer app for Android.

In this course you will learn how to make a user interface. Later we’re going to code a timer which can run in the foreground. Then we are going to upgrade it to be able to run also in the background – and we will control it from notifications! Finally we will create a settings activity where a user will be able to set the length of the timer.

In the second part we’re coding the actual timer (CountdownTimer) which can run in the foreground. We’re also using shared preferences to persistently store certain data like timer length or seconds remaining.


This post contains all the code that’s been written in this YouTube video.


You can also check out this GitHub repository: https://github.com/ResoCoder/TimerAppAndroidTutorial






Matej Rešetár

Matej is an app developer with a knack for teaching others. If he's not programming, making tutorials or doing other business, he's mostly working out, listening to audiobooks and taking cold showers.

  • Mustapha Ojo says:

    Please I’m having a problem with the app, I reached chapter 4 of the tutorial but then I realized that the timer resets when every time I pause it and then minimize the app but if I resume in the notification, It would resume from the previousTimerLengthSeconds.

  • >