Persistent Timer Android Studio Kotlin Tutorial | Background Stopwatch

Опубликовано: 15 Март 2022
на канале: Code With Cal
12,752
172

How to build stop watch timer that keeps counting even if the app is closed in Android Studio & Kotlin.

We will use shared preferences to store the timer start time, timer stop time and a boolean whether the timer is counting. Being saved in shared preferences means that when the app is closed the values are remembered when the app is opened again.

Based of these three variables we can then deduct what the time should be on the timer.

Source Code:
https://github.com/codeWithCal/Persit...

⏱️ TIMESTAMPS ⏱️
00:00 - Intro Persistent Timer App
00:38 - Build Gradle Enable View Binding
00:48 - Timer Layout XML
02:18 - Data Helper Share Preferences Helper Class
05:57 - Stopwatch Main Activity Kotlin
11:20 - Background Timer Demonstration

#AndroidStudio #KotlinProgramming


На этой странице сайта вы можете посмотреть видео онлайн Persistent Timer Android Studio Kotlin Tutorial | Background Stopwatch длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Code With Cal 15 Март 2022, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 12,752 раз и оно понравилось 172 зрителям. Приятного просмотра!