Starting our First Coroutine - Kotlin Coroutines

Поділитися
Вставка
  • Опубліковано 19 сер 2024
  • In this video you will learn how to start a coroutine in Kotlin and how to delay them.
    ⭐ Get certificates for your future job
    ⭐ Save countless hours of time
    ⭐ 100% money back guarantee for 30 days
    ⭐ Become a professional Android developer now:
    pl-coding.com/...
    💻 Let me personally review your code and provide individual feedback, so it won't backfire and cost you a fortune in future:
    elopage.com/s/...
    Put these dependencies in your build.gradle (app) file:
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5'
    Regular Android tutorials on my Instagram: / philipplackner_official
    Checkout my GitHub: github.com/phi...

КОМЕНТАРІ • 122

  • @codinginflow
    @codinginflow 4 роки тому +138

    The explanation with the construction workers was genius 👌

  • @akunvalid9447
    @akunvalid9447 11 місяців тому +1

    Rarely have I commented on a video, but this video is awesome

  • @unnibabu
    @unnibabu 4 роки тому +1

    The best video about Coroutine online! No begging for likes or subscribers, just pure knowledge!!... Thank you

  • @christopherteddymienarto9115
    @christopherteddymienarto9115 3 роки тому +1

    The explanation with the construction workers was easy to understand, Thanks!

  • @alvaroisea2259
    @alvaroisea2259 4 роки тому +8

    I'm just starting with kotlin and this series is helping me big time, thank you for that man!

  • @abdoghania2273
    @abdoghania2273 4 роки тому +1

    best android development channel on youtube

  • @zhurui1682
    @zhurui1682 Рік тому +1

    WONDERFUL explanation about coroutine!!!
    I was learning the Google Android tutorial about coroutine, but it was very unclear and hard to understand.
    Luckily I found this video. It was really detailed and clear.
    Thank you, Phillip!😄

  • @mattgraves3709
    @mattgraves3709 3 роки тому +1

    Returning customer, I love when I find a channel that I can use for a good reference and brother I am flying through this app build thanks to you!!
    Thank you so much!!

    • @PhilippLackner
      @PhilippLackner  3 роки тому

      Thanks for all your comments Matt, glad you enjoy the videos 👍👍

  • @ajaygalagali5963
    @ajaygalagali5963 3 роки тому +1

    Thanks! Construction analogy was so good

  • @janetdias475
    @janetdias475 Рік тому +3

    Every bit of your explanation is so crisp and clear😊 Thank you for your efforts🙏🏻

  • @hannanshaikh2616
    @hannanshaikh2616 4 роки тому +1

    Awesome, I shifted my development completely to kotlin by following your video, please create more videos on projects

  • @nrg4285
    @nrg4285 11 місяців тому

    Philipp, consider yourself lucky that you don't code in React Native professionally. Android is so nice I can literally go on 3 year old video and the content is not outdated (except for some config). I can reliably follow this tutorial and it will work no problem. I could not imagine following a 3 year old React Native tutorial, article, or StackOverflow issue and it still being relevant or working. I'm jealous.

  • @yogendrapawar1738
    @yogendrapawar1738 Рік тому +1

    clear and on point ... no rubbish talks
    impressed

  • @bharathprakash
    @bharathprakash Рік тому +1

    Thank you so much !! Clear Explanation

  • @Kunal-jp8tn
    @Kunal-jp8tn 2 роки тому +1

    Thank you so much for this video.

  • @AmanKumar-kz1rn
    @AmanKumar-kz1rn 3 роки тому +1

    kudos to your explanation
    this channel really deserves more subscribers

  • @jintumonisingha8717
    @jintumonisingha8717 29 днів тому

    Such a clear explanation loved it subscribed

  • @henriquepetters
    @henriquepetters 4 роки тому +2

    Dude, your content is what was missing in youtube. Thanks again and please, keep the videos coming. :D

    • @PhilippLackner
      @PhilippLackner  4 роки тому +1

      Thank you so much🙏🙏

    • @PhilippLackner
      @PhilippLackner  4 роки тому +1

      Would it be okay for you if I use your comment as a testimonial on my future website?

    • @henriquepetters
      @henriquepetters 4 роки тому

      @@PhilippLackner Please, use it.I hope there is no legal stuff you have to go through, tough. But no problem on my part. Thanks.

    • @PhilippLackner
      @PhilippLackner  4 роки тому +1

      @@henriquepetters with my own website I will have legal stuff to worry about, especially in Europe, but I can handle it. Thanks a lot, it really helps me!

    • @henriquepetters
      @henriquepetters 4 роки тому +1

      Anytime, my friend.

  • @stephend5305
    @stephend5305 4 роки тому

    don't know how i find this channel. Very easy to understand Coroutines.

  • @ShubhamSinghMusic
    @ShubhamSinghMusic 3 роки тому +2

    Really simple explanation 👌🏻
    Please never stop with such videos!

  • @Indently
    @Indently 4 роки тому +1

    Super cool!

  • @DharmikGohil-bw2ug
    @DharmikGohil-bw2ug 6 місяців тому

    Really simple explanation thanks

  • @tuqayabdullazade2565
    @tuqayabdullazade2565 4 роки тому +1

    Thank you, sir, for simple explanation

  • @vinodkamble216
    @vinodkamble216 4 роки тому +1

    Informative video
    Thank you
    Keep up the good work

  • @iamanegi
    @iamanegi 4 роки тому +1

    Thank you brother!🤗
    I was searching for the coroutines tutorial from a long time. Thank you very much.

  • @mattgraves3709
    @mattgraves3709 3 роки тому

    Excellent video and I will echo Florian and say the analogy was great.
    I enjoy both of your channels and that is one thing that you share that is essential in making the material stick.

  • @manjunathsharma1053
    @manjunathsharma1053 2 роки тому +1

    Best way of explanation with simple example. Thank you.
    Just to cross verify,
    1. application opens
    2. Execute the sequence of coroutine within Global scope.
    3. Hit back from activity.
    4. Come back to application globalscope coroutine is not launching the sequence again till I quit the app.
    Is this correct? If yes it means globalscope coroutines will run only once within activity scope? Please clarify

  • @montuedge
    @montuedge 6 місяців тому

    Example was quite good

  • @NicolasBeltrami
    @NicolasBeltrami 4 роки тому +1

    Awesome content!! i'm starting with kotlin and you're helping me a lot! Thanks!

  • @luislugo4006
    @luislugo4006 2 роки тому

    Thanks for this awesome video :)

  • @pankajrana9668
    @pankajrana9668 Рік тому

    that was so good explaination

  • @dawoodamir2011
    @dawoodamir2011 4 роки тому +1

    Well very good explaination looking forward for next content

  • @peshutanpavri1599
    @peshutanpavri1599 2 роки тому

    This is great. Thank you

  • @amineayachi335
    @amineayachi335 3 роки тому

    i love those coroutines well done man

  • @arjangap2551
    @arjangap2551 Рік тому

    Please enable divided sections in order to make using your connect more helpful and easy.

  • @go_better
    @go_better 2 роки тому

    Thanks! That was easy and...not scary at all!

  • @bhaktibirachan
    @bhaktibirachan 8 місяців тому

    Very Good and clear explanation.

  • @selvaganapathi7930
    @selvaganapathi7930 3 роки тому +1

    Hi, I'm watching more than 10 videos about co-routine. But still, I'm confusing. After watching 2 videos from the playlist I was clearly the concepts. thx & keep going...

  • @DungNguyen-ex8rh
    @DungNguyen-ex8rh 3 роки тому

    Awesome example! It really help me understand the concept, keep up bro!

  • @chiragprajapati3989
    @chiragprajapati3989 4 роки тому +1

    Awesome....just amazing

  • @mohammedsaleh9677
    @mohammedsaleh9677 3 роки тому

    What a great video

  • @yutaitadori7318
    @yutaitadori7318 3 роки тому

    Broooooooo ♥️loved this playlist

  • @debashishmahato4591
    @debashishmahato4591 4 роки тому

    Very well explained..

  • @r.j.jeninjoseph4975
    @r.j.jeninjoseph4975 3 роки тому

    Nice way to start liked the explanation

  • @vishweshwaranr2396
    @vishweshwaranr2396 4 роки тому

    Your video is amazing please always post it.. I'm great fan of yours...

  • @elpirato5428
    @elpirato5428 3 роки тому +1

    thx

  • @abdulazizrasulbek
    @abdulazizrasulbek 3 роки тому

    Good explanation with examples thanks

  • @devOmarAZ
    @devOmarAZ 3 роки тому

    u r GREAT!

  • @chintankhetiya9513
    @chintankhetiya9513 4 роки тому

    It's awesome 😌

  • @muzakkihafizh4169
    @muzakkihafizh4169 4 роки тому

    Thanks, it's help me a lot about Corutine

  • @OlivierGeorg
    @OlivierGeorg 3 роки тому +1

    No big theory, just step by step making us _feel_ how it works.

  • @pavelb3734
    @pavelb3734 4 роки тому +4

    "Охуительно!" means totally great, my friend, thanks a lot!

  • @play.againn
    @play.againn 4 роки тому

    That's what i need it. Let's Start :)

  • @tijojose2
    @tijojose2 4 роки тому

    Nice work

  • @semiautomaticpancak3
    @semiautomaticpancak3 Рік тому

    Man I'm so jealous of how well you can run than emulator lol

  • @Giorgi.Japiashvili
    @Giorgi.Japiashvili Рік тому

    60fps much appreciated

  • @ImaginaryProgrammer
    @ImaginaryProgrammer 4 роки тому +1

    Nice content

  • @jjhoninatan55sabadi
    @jjhoninatan55sabadi 4 роки тому +2

    Are you gonna do a video with Coroutines + Firestore ?

    • @PhilippLackner
      @PhilippLackner  4 роки тому +1

      First, I explain the general functionality of coroutines in some videos, what I do after that I don't know yet. But if some people request it, I will also show coroutines in a practical example

    • @jjhoninatan55sabadi
      @jjhoninatan55sabadi 4 роки тому +1

      @@PhilippLackner thank you !! I will continue to watch your videos. Great job.

  • @shawngardner261
    @shawngardner261 2 роки тому +1

    Is there a good approach of using coroutines for reading files. For example, I have an Android Java app that must read and parse this fairly large CSV file at startup. Doing this on the main thread is not a good idea since it affects the UI performance. So I use threads, but is there better way in Kotlin using coroutines, or just port the thread code over to Kotlin? Thanks!

  • @devopsshiv3842
    @devopsshiv3842 Рік тому

    In Coroutine why i have used GlobalScope() when i fetched data from API using Retrofit? Instead of GlobalScope() if i used different methods then what will happened?

  • @abondutta
    @abondutta 3 роки тому

    if i run a corutine for a long time, then the screen stays blank for long time. if i can show the screen as circular loading then it will be great.
    Ex: when doing a http request, if i can show a loader dialog then the user will know process is running

  • @alfietapping4034
    @alfietapping4034 3 роки тому

    4:10 my understanding is that the coroutine shouldn't run, as the main thread reaches the Log before the coroutine even starts, which should cancel all coroutines in the thread, could you tell me what im missing with this?

    • @PhilippLackner
      @PhilippLackner  3 роки тому

      Why would reaching the log statement cancel the coroutines? The main thread doesn't finish just because onCreate is finished

    • @alfietapping4034
      @alfietapping4034 3 роки тому

      ​@@PhilippLacknerI was testing this in intelliJ and the coroutine never launches so i guess I was just confusing myself
      fun main(args: Array) {
      GlobalScope.launch {
      delay(2000L)
      print("coroutine finishing
      ")
      }
      print("Thread finishing")
      }

  • @kevinsolanki6232
    @kevinsolanki6232 3 роки тому

    😌😌😌

  • @andyal868
    @andyal868 4 роки тому

    Sir, what is ?
    val TAG = "MainActivity"

    • @weeraphongsombatboon9568
      @weeraphongsombatboon9568 4 роки тому

      the TAG is the first value we insert into Log.d() . The value is just a String "MainActivity"

  • @smonkey001
    @smonkey001 2 роки тому

    5:43 I will say "by swiping away the app, we killed the whole application process, so all its threads and their coroutines got killed".

    • @user-bk5il2fy1h
      @user-bk5il2fy1h 2 роки тому

      i think the same coroutine get killed because of killing the app, global scope pointing to app lifecycle, not the main thread

    • @smonkey001
      @smonkey001 2 роки тому

      @@user-bk5il2fy1h You're right. app lifecycle is the Android term of application process.

  • @mohameddarwish1347
    @mohameddarwish1347 4 роки тому

    Sir; how can I use coroutines with a real api and receive data , how can I do it?

    • @PhilippLackner
      @PhilippLackner  4 роки тому

      I will probably show some practical examples of coroutines after the more theoretical part, but not about real api, rather in general about Retrofit/Firestore or similar stufd

    • @mohameddarwish1347
      @mohameddarwish1347 4 роки тому

      @@PhilippLackner
      Is retrofit a coroutines? I am confused about it

    • @PhilippLackner
      @PhilippLackner  4 роки тому +1

      @@mohameddarwish1347 no Retrofit is a library to get data remotely, coroutines can help do implement that in a good way

    • @mohameddarwish1347
      @mohameddarwish1347 4 роки тому

      Thanks 😊
      I'm looking forward to your next video 😊

    • @PhilippLackner
      @PhilippLackner  4 роки тому

      @@mohameddarwish1347 thanks!

  • @djfahed3002
    @djfahed3002 Рік тому

    Actually delaying a coroutine is the not the same thing as pausing it. I think there is no direct way to pause a coroutine.

  • @naughtymachinegun
    @naughtymachinegun 2 роки тому

    i see class i click away (H)

  • @Sk-gb2hx
    @Sk-gb2hx 3 роки тому

    +

  • @BavleenKaur10
    @BavleenKaur10 Рік тому

    boo vdai lgayega paaji tuhadi vedio par tuhadi foto ni disi te mere dill nu mza ni aayea

  • @TRUTHF0RCE
    @TRUTHF0RCE Рік тому

    The current docs only add the dependency:
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9")
    Is it correct? Or I need the "...corotines-core"?