Тёмный

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

Reso Coder
Подписаться 113 тыс.
Просмотров 71 тыс.
50% 1

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.
Get the code from this tutorial: wp.me/p8jOJP-7w
Go to my website for more information, code examples and articles:
● resocoder.com
Follow me on social media:
● / resocoder
● / resocoder

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 68   
@mkrass
@mkrass 6 лет назад
I really like this series so far, quite comprehensive in my opinion. However, I have some remarks about the code: 1. You should really, really, really use contentInsetStart on the Toolbar title. The trick with the spaces is a hack. 2. PrefUtil can be an object instead of a class. This way, you don't need a companion object to declare your static methods. 3. You should put your app logic (the timer logic and the preferences) out of the Activity and into e.g. a Presenter. The Activity should only deal with the UI. Also, I'd love to see some more Kotlin specific code in future videos, such as extension functions, or delegation. Keep up the great videos!
@ResoCoder
@ResoCoder 6 лет назад
+Max Krass Thank you for your remarks. I'm not really good with design patterns yet but that will change! One extension function will be in the next part ☺️ EDIT: Just finished recording the "next part". Extensions will be in the part after that. Sorry.
@Dark-jh8kx
@Dark-jh8kx 6 лет назад
very good tutorial thank you.But maybe better if you doing little slowly :) I have to stop every 15-20 sec to understand.
@robertminardi4268
@robertminardi4268 6 лет назад
I appreciate the tutorial and I'm working through it now, but one thing. The way you're coding is not how people really code. In this tutorial, we're typing code for 20 minutes straight without running the app. I can appreciate that you have the code all worked out and maybe a script, but it's making the tutorial extremely difficult to follow. You're explaining the function of the timer very matter of factly, but you're not demonstrating anything. Wouldn't it make more sense to get one part working, then another and then another. Addressing these issues along the way? You know, like how people actually code in real life?
@yugdamor5556
@yugdamor5556 5 лет назад
right
@chapchaf6802
@chapchaf6802 5 лет назад
agree
@hezekiahskyler9105
@hezekiahskyler9105 3 года назад
I know I am pretty off topic but do anyone know of a good place to watch new movies online ?
@kanedario7639
@kanedario7639 3 года назад
@Hezekiah Skyler Lately I have been using flixzone. Just search on google for it =)
@garrettfuchs2164
@garrettfuchs2164 2 года назад
This is the fastest tutorial I've ever seen. It's like he's trying to speed run making the app.
@yasserj3693
@yasserj3693 2 года назад
Great video I really appreciate your work, but it's a little bit confusing when you use the methods before you initialize it I think it will be more clear if you take it step by step in sequence.
@orangeflip
@orangeflip 5 лет назад
Hello i was wondering if what advantages there are to writing in Kotlin vs Java? Does it have anything to do with background/foreground services?
@trul77
@trul77 4 года назад
in 2020 PreferencesManager is depricated, so to use it add implementation "androidx.preference:preference-ktx:1.1.0" line in build.grandle and use this import line: import androidx.preference.PreferenceManager
@iqmal
@iqmal 4 года назад
omg thankk you. Btw your comment should be pinned abovr ahhah
@Spartacus69
@Spartacus69 5 лет назад
This is great tutorial style for someone already comfortable with programming. Even though my background is in python, you add nidbits that drive nuances home like nulls and (?) In kotlin.
@satyasingh4638
@satyasingh4638 5 лет назад
YOU ARE GENIUS PROGRAMMER, BUT BEFORE UPLOADING A TUTORIAL LIKE THIS, THINK LIKE YOU ARE TEACHING A PERSON WHO IS LESS GENIUS THAN YOU, THAT WAY YOU WILL TEACH BETTER, YOU ARE GREAT PROGRAMMER BUT A GREAT TEACHER.
@valdompinga
@valdompinga Год назад
Hello, thanks for your job is really really great! Is there a way to set the progress bar in reverse? instead of completing the rounded shape, do the reverse?
@rajatpalankar864
@rajatpalankar864 6 лет назад
please reply i need to add count down sound like tick tick .....
@pixelfox119
@pixelfox119 5 лет назад
if anyone is having a gradle error trying to do this tutorial today.. put this in the build.gradle in android{ }... compileOptions { sourceCompatibility JavaVersion.Version_1_8 targetCompatibility JavaVersion.Version_1_8 } this fixed my issue
@cevikmustafa1918
@cevikmustafa1918 2 года назад
thanks, perfect speed and explanation
@viditkhanna3721
@viditkhanna3721 6 лет назад
Countdowntimer doesn't execute the next line until the timer is finished, right?
@mortiganto
@mortiganto 6 лет назад
The progress bar resets when leaving the app. I have tried copying your code as well, but i get the same problem. Any ideas?
@ResoCoder
@ResoCoder 6 лет назад
Hello! I cannot say this with 100% certainty but I think this problem must have gotten fixed in later parts of this series (if it's not working after the 2nd part - but it should be working! :D ). The final version of the app doesn't reset the progress bar. When you come back to the app, its progress is set as you'd expect.
@angelescuba9746
@angelescuba9746 5 лет назад
The Material Progress Bar is giving me problems with the Manifest, anyone has the same problem???
@Hacksaah
@Hacksaah 5 лет назад
I did. The dependency that he copied and pasted from Github in the last video has been updated since this series was published. Change the dependency in you gradle file from 'me.zhanghai.android.materialprogressbar:library:1.6.1' to 'me.zhanghai.android.materialprogressbar:library:1.4.2'
@FathurrahmanAmin
@FathurrahmanAmin 5 лет назад
@@Hacksaah thank you
@EibeMandel
@EibeMandel 6 лет назад
Thank you very much, great work!
@nicolasca9592
@nicolasca9592 6 лет назад
Please make it to run in the background!!! Thanks for the series! love it
@ResoCoder
@ResoCoder 6 лет назад
+Nicolas Ca We're going to make it run in the background in the next part!
@nicolasca9592
@nicolasca9592 6 лет назад
Awesome! Thanks!
@mustaphaojo1758
@mustaphaojo1758 6 лет назад
I am getting this error Error:Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. > Could not create service of type AnnotationProcessorDetector using JavaGradleScopeServices.createAnnotationProcessorDetector().
@mohamedkhalifa7578
@mohamedkhalifa7578 5 лет назад
please can you converted it to xamarin android . i tried to run countdown timer in background but doesn't work in xamarin >> help please
@AleXoTroN
@AleXoTroN 6 лет назад
Nice Tutorial!! Which editor theme do you use?:o
@TwilightPhantom1
@TwilightPhantom1 5 лет назад
Thank you! Really great tutorial set!
@cool08player
@cool08player 2 года назад
It was hard following your code. It would have been better if you ran the app each time after writing a piece of code or function, that way we can see exactly what is going on. Thanks
@shubh9207
@shubh9207 3 года назад
I'm trying to make the same app but I'm making it inside an activity but I'm not able to set the context and the code is also not running when i set the context to "requireContext()" instead of "this" so can someone help me out.
@jeisonfabiancastillobenite3487
How do I start the timer without using the button ?, that is, at the moment when the activty opens, help me
@luisdelacal704
@luisdelacal704 6 лет назад
Hey, I watched your whole tutorial and first of all thank you so much for this detailed explanation on how to make a timer app. I followed all of your steps in Java because it is the language that I have known for a couple years now, but your video has made me look forward to learning Kotlin in the future, thank you very much. I´ll leave here my GitHub Java translation of your project in case anyone wants to look at it for reference. I say your name in the description, but if you want me to add more credit to you please tell me. github.com/luiscal4a/Android_Java_Timer_App
@ResoCoder
@ResoCoder 6 лет назад
Wow, thank you for providing the Java equivalent!
@plabanmondal3111
@plabanmondal3111 5 лет назад
How did you set that 0 to default? 9:50
@mohammedjouda3792
@mohammedjouda3792 4 года назад
Good job keep going When running it gives me java.lang.IllegalStateException: progress_countdown must not be null 8/8/2020
@Ematolah
@Ematolah 6 лет назад
hey dude whats that theme
@АндрейНова-т6ь
@АндрейНова-т6ь 4 года назад
Please tell me how you can change minutes to days and hours. I study
@shlomogevim4801
@shlomogevim4801 5 лет назад
great work man, great work.
@bhaskarrajaryal6678
@bhaskarrajaryal6678 6 лет назад
Hello I am getting this error "kotlin.UninitializedPropertyAccessException: lateinit property timer has not been initialized"
@ResoCoder
@ResoCoder 6 лет назад
Could I know more? You must be accessing a lateinit property before it contains any value.
@ravronz9677
@ravronz9677 6 лет назад
Hey can u make this in only java
@luisdelacal704
@luisdelacal704 6 лет назад
github.com/luiscal4a/Android_Java_Timer_App
@MrFlamingFX
@MrFlamingFX 6 лет назад
im new to kotlin could you help "updateCountdownUI is an unresolved reference"
@MrFlamingFX
@MrFlamingFX 6 лет назад
nvm just forgot to capitalize d in down
@malupet024
@malupet024 6 лет назад
Do you have a java of this tutorial?
@luisdelacal704
@luisdelacal704 6 лет назад
github.com/luiscal4a/Android_Java_Timer_App
@ojogaming
@ojogaming 5 лет назад
Thanks
@이근희-b3d
@이근희-b3d 4 года назад
Tahnks video
@iskandarjava6608
@iskandarjava6608 6 лет назад
nice. but how I make it smoother?
@iskandarjava6608
@iskandarjava6608 6 лет назад
oh nvm I found it
@AhmedAli-jx9ie
@AhmedAli-jx9ie 4 года назад
@@iskandarjava6608 how ?
@infinite4105
@infinite4105 6 лет назад
keep up great work
@ResoCoder
@ResoCoder 6 лет назад
Thanks! I will :)
@shreyasingh4680
@shreyasingh4680 2 года назад
My app keeps stopping
@danylfernandes6741
@danylfernandes6741 3 года назад
Very confusing, man! There's no space to even take a breather; and I'm not even an amateur, but I couldn't get anything :(
@iqmal
@iqmal 4 года назад
laju je hang tak sempat follow ahahha
@carlosroberto366
@carlosroberto366 4 года назад
8:30 say what??!!
@versatileman6129
@versatileman6129 3 года назад
Нихуя не понял, но очень интересно
@abhijitghate6042
@abhijitghate6042 5 лет назад
NOT AT ALL FOR BEGINNERS!!! IF YOU ARE ONE, DON'T WATCH!
@siddharthchand2930
@siddharthchand2930 5 лет назад
Man you need to slow your speed
@vijaymadaan9094
@vijaymadaan9094 4 года назад
dont watch this video the method he is using has depreciated from the java libraries