Making Our Service a Foreground Service - MVVM Running Tracker App - Part 12

Поділитися
Вставка
  • Опубліковано 1 січ 2025

КОМЕНТАРІ • 85

  • @VeskoLatchev
    @VeskoLatchev Рік тому +5

    For those who struggle with android 13
    1.Just add POST_NOTIFICATIONS and FOREGROUND_SERVICE permissions to manifest.
    2. Add request permission at runtime (for POST_NOTIFICATIONS) before sendCommandToService

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

    If you try to follow this tutorial in 2023, you need to fix some points by yourself. In TrackingService, PendingIntent needs not only FLAG_UPDATE_FRAGMENT but also FLAG_IMMUTABLE. And notification system has been changed a lot. At least you have to add POST_NOTIFICATIONS permission to manifest.

  • @ishwarkumar9099
    @ishwarkumar9099 4 роки тому +15

    one of my fav youtuber

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

    Are you magician? You really blown me away with your explanation. How could you be so clear and precise while explaining. Just really awesome. Enjoying a lott.............

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

    Thanks you so much! I write rare in comments but always thumb up, cause i like your explanation style, clean speech, and in the end when you summary all what we have done in this part, make sure for brain that this part exactly understood obviously) Dont stop to do this great staff, and im sure you are going be one of the best Android teacher in UA-cam. Good luck! ;)

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

    Before starting service from the fragment it also make sense to check if Notifications are NOT disabled for this app and Backround Mode is allowed as well. Otherwise - show dialog that navigates the user to the Settings. (Similar to EasyPermission logic)

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

    The perfect android tutorials do exist

  • @Abd-Elrahman_Esam
    @Abd-Elrahman_Esam 4 роки тому +1

    my favorite teacher really you Deserve all the support

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

    Now I'm clear in foreground and background services with notification and navigation Intent :) nice explanation brother.

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

    you could use deeplink to navigate to a specific fragment

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

    Kudos , This is really helping me to move to kotlin and new Architecture .Thank you

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

    awesome android tutorial. you explain every detail of any function which is GREAT ❤, so we don't need to pause the video in order to do some research about it.

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

    I can't believe I never saw this channel before.
    You deserve my Subscription.
    Keep up the good work!

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

    Top Notch Explanation about pending intent

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

    Wow that was great explantation, keep going from London

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

    Awesome tips, that was the best 2:57

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

    Very good and clear explanation on foreground service and notification. Thank you!!

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

    Thank you very much for your free course and the valuable time that you spent to educate people.As you said I disabled AdBlock.

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

    You're awesome Philipp, I'd like to watch this video thousand times again and again! seriously! :))))

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

    Amazing explanation and example, thank you Philipp!

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

    You're a bad man. I love you bro. My fingers are itchy, time to code

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

    in 15 minutes the service was killed. Please I want to run a service that will not be killed
    because I want to check changes from a server and notify a user. How Can I do that

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

    Thank you Phillip! very useful content!

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

    Simply Awesome kudos to explination

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

    Thanks you very much! Very good tutorial. Is there a way to implement this for API Level 17 (below OREO, without notificationmanager)

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

    Great tutorial, you really make complex easy

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

    Learned alot of new thing dude thanks for this series.

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

    Great tutorial! I appreaciate your work so much!

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

    why singleTop is needed if you have already set "singleTask" launch mode in the manifest file?

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

    Super informative video

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

    Why can't we create getTrac
    kingPendingIntent() in setContentIntent instead of using getMainActivityPendingIntent() and then launching TrackingFragment.

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

      Sure, we could do that, but then our code starts to become really messy. You should always try to structure it in functions that tell you what they do. Later we will also inject this pending intent with dagger hilt

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

    Hello @Phi, I hope you are well, thank you very much for your content, it has helped me a lot.
    On the other hand I am implementing this notification logic but I am using jetpack compose and I don't know how to launch the onNewIntent from compose, if you can offer me a guide I would really appreciate it.

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

    What about a download notification with ETA and a cancel button?

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

    Great Tutorial

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

    setAutoCancel and setOnGoing don't seem to be necessary if you're starting a foreground service. I was running the foreground service without these options and notification was not swipable nor did it disappear when clicked.

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

    Hello Philipp there is a problem with foreground service in some devices there is a saving battery mode called (ultra power saving mode) that kill all services even the foreground service after the mode is turned off there is no way to tell the foreground service to restart again automatically even broadcast receivers will not work anymore after that mode like bootcomplited please if you can help i will be very thankful

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

    Very helpful video , thank you

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

    Great tutorial, but how do you import your constants? I can only complete with the class prefixed...

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

    Hi bro,
    I watched your tutorials it was awesome, but I found problem regarding the foreground service. When I run the foreground service while the screen is on, it works perfectly fine. But the moment when I off the screen with in few minutes android kills the foreground service
    I am using Huawei honor 9.1.0.168 (android pie)
    I am aware of dontkillmyapp.com I could fix that problem in the power saver settings. But that takes an additional step for user.
    Please reply me if you found any solution without that additional step in settings, it could help not only for my project but also for building new foreground service package in flutter, so that it could be helpful for other flutter developers as well.
    Anyway this is a wonderful series. Thank a lot from Indian developer

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

      What I've heard is that some Chinese devices even kill foreground services. In that case you can't do too much about it, but I also haven't encountered that problem

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

      Okay @@PhilippLackner thanks for your replay

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

    amazing bro !!

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

    When I click on the notification, it's opening a new instance of the activity, instead of opening the one already running. Does anyone know how to solve?

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

      Same shit. Did you find a solution?

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

    Thank you 🙏

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

    Epic!

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

    I love you how I never had loved before

  • @22g2g2g
    @22g2g2g 4 роки тому

    Top 👏👏👏👏

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

    Great Video!!

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

    You're great bro!

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

    why when I close the application the notification is gone(real device).

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

      Because you closed it, you kill the app and the service with it. Try that with Spotify and you will experience the same

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

      @@PhilippLackner but in the emulator when the application is closed the notification is still there

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

    👏👏👏👏

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

    Exactyl what i needed

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

    for who face foreground service permission error for api 28+
    Add this to manifest :

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

    clicking on notfication always keep me back to my home fragment .. Android don't give a f... about my graph action ... I'm turning mad !

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

      kotlin.TypeCastException: null cannot be cast to non-null type androidx.navigation.fragment.NavHostFragment

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

    BOMB!!!

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

    Nice Tutorial, can you provide this in Java ?

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

    My Oppo kills all the foreground services. Say hello to Chinese manufacturers

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

      I also have a chinese phone (OnePlus) and for me it works fine

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

      @@PhilippLackner That's odd. I've read blogs where developers mostly complain about One Plus and Huawei. Maybe the model and make matter. Also my phone is running out of internal memory but would it affect the foreground service? I thought it was only dependant on RAM..