Understanding and Using Services in Android: Background & Foreground Services

Поділитися
Вставка
  • Опубліковано 29 гру 2024

КОМЕНТАРІ • 114

  • @frax84
    @frax84 2 роки тому +29

    I give you 3C score for this video: Concise, Complete, Clear. Really good explanation. Thank you

  • @DebugWithAdam
    @DebugWithAdam 3 роки тому +9

    I have been looking for something like this to complete our 5 months flutter project, finally I got the solution from your content. Thank you so much, looking forward to seeing more contents

  • @roman71717
    @roman71717 2 роки тому +5

    This is one of the best-explained tutorials I have watched!!
    Thank you :)

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

    Best video on utube regarding services in android... 👍👍👍👍

  • @itallstartedwhen
    @itallstartedwhen 3 роки тому +5

    Best video on the topic on UA-cam, so well explained 😍😍😍😍😍😍😍😍

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

    Good example how simple it could be, when guide is so clear and opened step by step, thank you sir.

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

    Thank you. I'm looking for this video longtime.
    Be blessed. Soyez béni mon frère.

  • @truthonly_
    @truthonly_ 2 роки тому +5

    Ultimate content. I never understood services that easily ever before. Thank you 🤟

  • @strawberryinc.2275
    @strawberryinc.2275 2 роки тому +3

    i really needed this, @Codeible, thank you big time.

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

    I wonder who organised the naming if foreground vs background. Unbelievable, thanks for clearing it up

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

    Thank you. Best Service tutorial ever.

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

      Terbaik servies dia..tapi home Macan setan dia...malu.out site..setan bertanduk lima..celaka

  • @Somerandomnessvvv
    @Somerandomnessvvv 3 роки тому +4

    Come onnn this gotta be one of the best practical service tuts. Can’t wait to see you work with kotlin.

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

      Yesss good job baby..setan kocak bini orang sampai dsana ..party sex u setan...

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

    Amazing and simple explaination. Thanks. Keep up the good work 👍

  •  3 роки тому +4

    Thank you for clear and worked practice even on API 28. Great work. More android tutorials please.

  • @darklaker
    @darklaker 2 роки тому +2

    The best explanation for services I've found and it's just what I needed. I would add a handler to show a toast message from the service.
    Handler mainHandler = new Handler(getMainLooper());
    mainHandler.post(new Runnable() {
    @Override
    public void run() {
    // Do your stuff here related to UI, e.g. show toast
    Toast.makeText(getApplicationContext(), "Message from Service", Toast.LENGTH_SHORT).show();
    }
    });

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

    Clear Cut simple and Illustrative video, good for starters.

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

    Very clear and direct explanation of the different service types. 👍
    However you mention that multiple instances of the service will get created if started multiple times, but this isn't so; there will only be one instance of the service object but its onStartCommand() function will be invoked those multiple times.

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

    you're salve my life bro, i have weeks searching this info. Thanksh! like and new sub

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

    I left java 3 years ago .and start using kotlin . But your explanation is So good that I end up subscribing to your channel. Hope you start using compose multiplatform 🙂 this is the very first video from you that I watched .so don't you if you are already using kotlin . Anyway nice video ..

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

    Very good explanation..!!👏

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

    Nice explanation.... you're awesome man 👍🏻

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

    Awesome video my dude. Really clear.

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

    man ! thank you very much for your awsom explaination for that topic

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

    This was a good video. I learned so much in a short amount of time!

  • @MauricioSouza-93
    @MauricioSouza-93 8 місяців тому

    Great explanation!! Thanks!!

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

    Im your new Subscriber because of your video i easily understand some coding stuff

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

    nice tut crystal clear and spot on

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

    nice video, helped me so much!

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

    Great explanation helped me a lot.
    Hence subscribed.

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

    I have tested this on real device when I restart the device I didn't see the notification that you got...? Is there anything to add more?

  • @D-Coder440
    @D-Coder440 5 місяців тому

    Osm! Thank you bro for this helpful video

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

    Very good explanation.

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

      @instagram I cant answer It. I have limited knowledge and experiance.

  • @mdrashid6002
    @mdrashid6002 7 місяців тому

    Great Thanks boss for such a clear explanation,
    What about the Bound Services??

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

    Thank you❤

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

    Thanks for this great video!

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

    Thank you, this video was really usefull

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

    If i use NDK to run a C++ library, which service should i use to run the code out of process? Sometimes C++ crashs and i want them to take a service down but not the whole app. So i need to do the same as all webbrowsers do it.

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

    I like your videos a lot please share more videos with us

  • @قناةالرياضيات-ن7ر
    @قناةالرياضيات-ن7ر 3 роки тому +1

    I hope to learn how to play the list view of music through the service by Raw or Assest folder to work in background long time ... thanks for this video

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

    I believe from what I read on google documentation, that there is no need to check if the service is running. Apparently, that was a bug.

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

    Thanks bro... very helpfull

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

    so helpful thank you very much 😊
    does it work with all android versions specially oreo or higher ?

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

      Hello it should work for API 26 or higher.

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

      @@Codeible Any alternate service to run for below 26.

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

    very nice thanks for this video.

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

    How would you stop the foreground service?

  • @AnuragSingh-eb6of
    @AnuragSingh-eb6of 2 роки тому

    How I can block wifi internet from using to a specific app in aops /os

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

    Android 12 & 13 How long will it be running Foreground service??

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

    Thank you very much

  • @mychannel-jb3zk
    @mychannel-jb3zk Рік тому

    I understand that telegram had an unlimited open service in background, how it is posible?

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

    I have created an alarm app in Android 11, but it does not work when the app is closed. Does anyone know where the problem is ??

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

    if service stops after few seconds then what to do?

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

      If the service stops, it could mean that the task is finished. If you want to keep it alive, you need to do something to keep the service alive like a while loop.

  • @Hanna-ir6te
    @Hanna-ir6te 3 роки тому

    Thanks for this tutorial. May I know how how to create second application which will run in the background service when first application is processing without interacting of first app?

  • @pietrolanuti2571
    @pietrolanuti2571 4 місяці тому

    in android 14 sdk version 34, when the app closes the foregroundservice also closes. Are there any solutions for this? Thanks

  • @LasWegas
    @LasWegas Рік тому +2

    Great!

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

    U have udemy courses?

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

    Great Video! Is there a way to stop the Service by code?

  • @Hanna-zj1gk
    @Hanna-zj1gk 3 роки тому

    This tutorial is very helpful. May I know how how to create second application which will run in the background service when first application is processing without interacting of first app?

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

    If phone is idle mode background service is not working. How to do this??

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

      You need to use foreground service.

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

      @@Codeible Example you have provided is with foreground service only right?

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

      @@harleenarora5189 Both Foreground and Background.

  • @67Diadem
    @67Diadem 2 роки тому

    After restarting the app background service is not displaying in the notification area. I have tested on my mobile. Please help 🥺

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

    Very useful!!!

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

    For me only one notification was being created even without checking if the service is running already or not....

  • @NghiaNguyen-hn5st
    @NghiaNguyen-hn5st 2 роки тому +1

    its amazingg thanks you

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

    thank you!!

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

    Thnks a lot

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

    Normally the codes working fine but when i add a webview in main activity then foground service stopped when apk closed. Is there any solution for it. I want to keep webview in my project and also want the foreground service

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

      Hi, should still work.

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

      @@Codeible not working after adding webview 😭😭

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

    Can you make this in kotlin ?

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

    There is no code for stopping foreground service

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

    Thanks alot bro

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

    Thank you for the sharing! Any idea we can get Firestore document update if our app is terminated?

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

      Hello,
      Yes you can.

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

      @@Codeiblewhat method should we implement to update client document if app is terminated

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

      @@jeremyheng8573 What do you mean? You can just update the document like normal using the Firebase API for Android.

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

      Hello good job.....nerka u all setan...nice...tqqqq

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

    Is there a way to have a foreground service without a notification ?

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

    Very helpful

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

    the app works fine in the background, but if I want to use it in the foreground it crashes after about 7 seconds. I don't know why

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

      Use wake lock with no time limit to make foreground service work infinitely. But never forget that unnecessary amount of foreground service usage is a real battery killer

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

    ua-cam.com/video/bA7v1Ubjlzw/v-deo.html Here, the service is stopped. But the service is not explicitly stopped by calling stopService() or stopSelf() from within the service itself or by another component such as an activity or a broadcast receiver. I wonder why? Thx :)

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

    i cant able to receive broadcast after my app has been killed

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

    waaaaaaaaaaaaaaaaaaaaaaaaaw ma bro its amazing

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

    fail when stop service and after 10 seconds enable

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

    How to keep running the service even we kill the app ?

    • @Codeible
      @Codeible  2 роки тому +2

      Create a foreground service - 3:43
      If you want to restart the service automatically, create a broadcast receiver - 11:12

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

    Awesome

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

    so thanks you bro

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

    great bro , but im looking for Bound service impl 🙂

  • @Nick-cx4rs
    @Nick-cx4rs Рік тому

    Yo how this receiver working really we didnt even set registerReceiver()

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

    how to stop..

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

    Thanks

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

    Thanks

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

    amazing

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

    thanks

  • @Hong-Mu
    @Hong-Mu 2 роки тому

    useful

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

    n1

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

    Why so many ads dude? I watched sum of 1.5 mins ads whole through this video

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

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

    Awesome

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

    Thanks