THIS Is How You Schedule Alarms on Android with AlarmManager

Поделиться
HTML-код
  • Опубликовано: 7 янв 2023
  • In this video I'll show you how you can schedule alarms in Android using AlarmManager.
    ⭐ 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/premium-courses...
    💻 Let me be your mentor and become an industry-ready Android developer in 10 weeks:
    pl-coding.com/drop-table-ment...
    Subscribe to my FREE newsletter for regular Android, Kotlin & Architecture advice!
    pl-coding.com/newsletter
    Join this channel to get access to perks:
    / @philipplackner
    Get the source code for this video here:
    github.com/philipplackner/Ala...
    Join my Discord server:
    / discord
    Regular programming advice on my Instagram page: / _philipplackner_
    Checkout my GitHub: github.com/philipplackner
    You like my free content? Here you can buy me a coffee:
    www.buymeacoffee.com/philippl...

Комментарии • 94

  • @sreeranjas6585
    @sreeranjas6585 Год назад +2

    Man you are a legend the best teacher i was searching for this topic

  • @FemiOkedey
    @FemiOkedey Год назад +1

    This is a sore topic for me
    I just recently spent hours debugging. Thank you for this, it helps a lot

  • @Leon-un2ii
    @Leon-un2ii Год назад

    Thank you sooo much for making a video about this topic, which I wished before!

  • @zelotbe
    @zelotbe Год назад +4

    Thank you man! I just needed this for my project.
    I'm definitely gonna check out your premium courses.

  • @simpleuxapps8759
    @simpleuxapps8759 Год назад +9

    Why using setexactandallowwhileidle and not setAlarmClock?

  • @venkateshlingampally7220
    @venkateshlingampally7220 Год назад

    Thankyou so much for this video 🔥🔥 you are just osm man 🤯

  • @GN9K71
    @GN9K71 Год назад +6

    Please make more detailed video about managing alarms in dozen mode, or when the device is in low power mode(in different bucket). How we should handle that.

    • @ka61er
      @ka61er Год назад

      Work manager + auto start in poco device worked for me which is china's device

  • @mayurpatil5168
    @mayurpatil5168 Год назад +1

    Hi Philipp, please make some videos about AOSP integration and its use in Android Studio projects. Thank you..

  • @baharudinmaulana78
    @baharudinmaulana78 Год назад +5

    Good video Philip. Actually now seek good tutorial about it and finally you make video about alarm guide, I will open for feedback, i waited 😃😃

  • @denisgithuku8563
    @denisgithuku8563 Год назад

    Eventually someone came out and gave us the real pill we needed

  • @sercan272727
    @sercan272727 10 месяцев назад +2

    I need alarm receiver to keep listening for events in background after alarm is scheduled , and even if app is closed , screen is turned off, I want to wake up device to display something on screen when the alarm time comes . how to achieve this ? for some reason I cant start an activity after i quit the app

  • @mohamedsanoob.k1116
    @mohamedsanoob.k1116 Год назад

    Most wanted tutorial ❤️❤️❤️👍

  • @kenali4612
    @kenali4612 Год назад

    Thanks philipp!

  • @arunrajkumard5238
    @arunrajkumard5238 Год назад +1

    You always rocking...

  • @tochukwuokey-munonye7884
    @tochukwuokey-munonye7884 Год назад +1

    Please since alarm manager is in data layer. How do we pass context to the alarm manager if we are not supposed to pass through viewmodel

  • @trocchiettoski
    @trocchiettoski Год назад

    a new suggestion. Often as daily life we have to parse map a long data transfer object from json and adapt to the UI model, well we need to use a lot of transformations as flatmap, map, to flatten, combine flows, what to parse in json and what not etc, some use cases short video would be useful, some strategies, guidelines for messing API, that is a challenge we daily face

  • @hemantjain9912
    @hemantjain9912 Год назад +1

    Hey, Can you please make one video on custom theming in jetpack Compose. How to implement and full guide.
    Thanks in advance

  • @gouravrawatscience
    @gouravrawatscience Год назад +3

    But sir in Chinese manufacturers phones like Xiome, realme, redmi etc. Kill alarms.
    They also kill work manager and job scheduler.
    Anybody answer will be appreciated😊😊.

    • @ka61er
      @ka61er Год назад

      my poco x3 pro, redmi note 7 never kill work manager or job scheduler like you say

    • @sufiyanshaikh3754
      @sufiyanshaikh3754 5 месяцев назад

      @@ka61er we need to enable autostart on the above phones. Otherwise, it kills workmanager and job scheduler.

  • @So7696
    @So7696 Год назад

    Thank you Philip

  • @proandroiddevir
    @proandroiddevir Год назад

    Thank you Philip🙏🙏🙏🙏👏👏👏👏👏👏👏👏👏👏👏

  • @mikelantzelo
    @mikelantzelo Год назад

    Thank you!

  • @gelsonschikorski8158
    @gelsonschikorski8158 Год назад

    Awesome!

  • @KumarSiddhant-j9w
    @KumarSiddhant-j9w Месяц назад

    Hey Philipp thank for this video it is really helping me but i am trying to code a module where i want to trigger a alarm when android device is in lock state where i want to show a screen or custom image and custom sound.

  • @user-uz8qe7pf6t
    @user-uz8qe7pf6t 7 месяцев назад

    Sir really need your help in one thing how can we set an alarm on a day which is after a week or after 10 days. What are the additional things i should add to the code please help

  • @raheemadamboev
    @raheemadamboev Год назад

    I think USE_EXACT_ALARM is added on Android 13, so we still need to request it using SCHEDULE_EXACT_ALARM for Android 12 and Android 12L devices, am I right?

  • @nicolasnguyen1611
    @nicolasnguyen1611 5 месяцев назад

    @PhilippLackner
    Have you encountered this error at your production apps?
    The maximum limit of 500 simultaneous alarms has been reached for uid: ...
    I've searched a lot of forums but can't find a good solution.
    Thank you

  • @luisdanielmartinezbarrios532
    @luisdanielmartinezbarrios532 Год назад

    Nice video 👍 👌 😉

  • @nabin625
    @nabin625 Год назад

    Thank you for this awesome video your videos really helps us to learn more, keep uploading.
    Also a simple query "Can anyone tell or have any resources links for mvvm clean architecture. Where we should put services, broadcast receivers related logic."

    • @maskedredstonerproz
      @maskedredstonerproz Год назад +1

      I personally make a framework layer for the actual services and whatnot, and in the domain layer just have a connection class or something like that. What I also want you to know is that people have just put them in the domain layer, so it largely depends on personal preference

  • @moustafaelsaghier8552
    @moustafaelsaghier8552 Год назад +3

    That's the same I'm doing but on devices like ( OPPO - REDMI - XIAOMI ) is leading to not firing the alarm manger and it's working only if i removed ( manually ) app from being not optimized from bettary optimization screen in settings, can you help me in that?

    • @sufiyanshaikh3754
      @sufiyanshaikh3754 5 месяцев назад +1

      Heyy,
      Did you find any solution??. I also want to use an alarm manager to notify users at a specific time.

  • @damorpl
    @damorpl Год назад

    Thanks for the video. I was about to implement alarm manager so it was perfect timing. What about cancelling all alarms previously set?

    • @PhilippLackner
      @PhilippLackner  Год назад

      As shown in the video use alarmManager.cancel

    • @damorpl
      @damorpl Год назад

      @@PhilippLackner In the video you show how to cancel individual alarm but I was wondering if the is a way to cancel all alarms at once

  • @deepsheth1086
    @deepsheth1086 Год назад +1

    hey philip! its good video but there is a problem it doesn't work if we kill the app...

  • @rahulbhandari8093
    @rahulbhandari8093 Год назад +1

    how to schedule alarm when the app is not in background ??

  • @Akshaykumar-xr9yj
    @Akshaykumar-xr9yj 11 месяцев назад +1

    Hi phillip, I have a question. How can i fit Alarm manager in clean architechture. Where should i put broadcast receiver and AndroidAlarmSchedular class. i can't put broadcast receiver in data layout. becuase I have to perform bussness logic in broadcast receiver. domain layout is also not an option. If i put it in presenter layer then i have to put AndroidAlarmSchedular as well in the presenter layer. But i think AndroidAlarmSchedular should be in data layer (from the context of video). I didn't found this perticular use case in any of your youtube video or paid course except last one that i don't have.

    • @TeinOcnalb
      @TeinOcnalb 9 месяцев назад +1

      data/repository - AndroidAlarmSchedulerImpl
      domain/model - AlarmItem
      domain/repository - AndroidAlarmScheduler
      presentation - BroadcastReceiver

  • @stivcabs1381
    @stivcabs1381 Год назад

    how can i make this for specific time, like alarm in the morning? i mean like alarm apps

  • @utkuduman7231
    @utkuduman7231 Год назад

    my phone (old zenfone 6, lolipop) does not turn on when the alarm rings, can this solution work?

  • @sebastianlang9034
    @sebastianlang9034 23 дня назад

    Hi, I am currently working on an app and would like to know if the AlarmManager only accepts a certain number of orders and how far in the future these may be. Currently, all orders that are more than two days in the future are not executed. :-(

  • @trocchiettoski
    @trocchiettoski Год назад

    a new suggestion, showing the new raamcosta navigation library with a navigation
    bar bottom (and as a bonus a screen with a detail ex clicking an item as in the stockapp you did)

  • @subhodas6268
    @subhodas6268 8 месяцев назад

    If i clear my app from resent app.........will my alarm work ok??

  • @LEEJIHUN
    @LEEJIHUN Год назад

    thanks!

  • @adrianbartoszek6635
    @adrianbartoszek6635 Месяц назад

    You look do good i didnt know if this is a programming or some buisness guy xd

  • @mannb1023
    @mannb1023 Год назад

    can you make a video on repeating alarms? Say a daily notification

  • @LucasYamato
    @LucasYamato Год назад

    Hello I intend to buy your course wanted to know if in the videos has how to use subtitle Portuguese on the platform you make available the course as we do here on youtube.

    • @PhilippLackner
      @PhilippLackner  Год назад

      The platform where I host them sadly doesn't support subtitles sorry!

  • @nullpointerexception1052
    @nullpointerexception1052 Месяц назад

    How come every single time I follow *any* scheduled alarm/notification tutorial, it *never* works

  • @maurolanini9891
    @maurolanini9891 Год назад

    does the alarm manager only work with the background app? or also to wake up the closed app or are there alternatives for this operation?

    • @rahulbhandari8093
      @rahulbhandari8093 Год назад

      hey did you solve your query. i am stuck too??

    • @maurolanini9891
      @maurolanini9891 Год назад +1

      @@rahulbhandari8093 yeah schedule alarm can wake up the device

  • @4ytonly
    @4ytonly 6 месяцев назад +1

    And if we don't use permissions in manifest, or use standard SCHEDULE_EXACT_ALARM do we need to ask user in code with a dialog to grant permission?

    • @Sandeepyadav-zr5ix
      @Sandeepyadav-zr5ix 5 месяцев назад +1

      I also need answer for this

    • @4ytonly
      @4ytonly 5 месяцев назад +1

      @@Sandeepyadav-zr5ix I solved this, this dont go as permission, but user has to go to settings and enable. Also you cant check this like the standard permission, you have to use alarmManager.canScheduleExactAlarms()

  • @maskedredstonerproz
    @maskedredstonerproz Год назад

    3:47 Don't implementations go in the domain layer while the abstraction goes in data layer??

  • @techienomadiso8970
    @techienomadiso8970 Год назад

    Odin sends his regard @Philip 😅

  • @loicjackotin9633
    @loicjackotin9633 Год назад

    Hey Philipp, I got some questions.
    Do you often update your paid courses? I want to buy some.
    And will you make a Discord server? I think it can be cool

  • @bolokurowo5867
    @bolokurowo5867 Год назад

    Good

  • @CryptoCodeZone
    @CryptoCodeZone Год назад

    Please Explain
    var someVariable by mutableStateOf(value = "")
    private set
    The private set part

  • @rebecaalbuquerque96
    @rebecaalbuquerque96 Год назад

    Anyone having problem when the alarm trigger seconds is longer than 24 hours? I'm not receiving the notifications when is more than 24 hour, when is less than 24 hours it works

    • @jagnathreddy3544
      @jagnathreddy3544 Год назад

      How did you even do that? I'll passout waiting for the alarm

  • @abdy9415
    @abdy9415 Год назад

    👍👍

  • @weslleycampos
    @weslleycampos Год назад

    Workmanager para rodar no boot.

  • @doanvu7685
    @doanvu7685 Год назад

    how to make it interval day with min sdk: 21

  • @Skumfuk01
    @Skumfuk01 Год назад +1

    Does it still trigger if you kill the app?

    • @PhilippLackner
      @PhilippLackner  Год назад +1

      Yes

    • @ibrahimkhalilshakir2414
      @ibrahimkhalilshakir2414 Год назад

      @@PhilippLackner if we kill the app. That's mean background service is not working. So, how the alarm trigger when app is not in background?

  • @luisdanielmartinezbarrios532
    @luisdanielmartinezbarrios532 Год назад

    Can you do an application using that and jetpack compose?

  • @ano9161
    @ano9161 Год назад

    At first I thought I was watching on X1.5

  • @gauravthakkar802
    @gauravthakkar802 Год назад

    Why not use WorkManager?

    • @PhilippLackner
      @PhilippLackner  Год назад +1

      Have you watched the video?

    • @gauravthakkar802
      @gauravthakkar802 Год назад

      @@PhilippLackner Oops, nope, but I'll do that now
      I was just curious since, AlarmManager is a mess atleast as per docs, and they push WorkManager themselves
      But seems like you've answered it, so I will watch it

  • @rahulbhandari8093
    @rahulbhandari8093 Год назад

    can you make it in java ?

  • @hugosalazar6911
    @hugosalazar6911 Год назад +1

    first

  • @rahijain5199
    @rahijain5199 Год назад

    Hdjdd

  • @gofudgeyourselves9024
    @gofudgeyourselves9024 Год назад

    Are you god?

  • @hemantjain9912
    @hemantjain9912 Год назад

    Hey, Can you please make one video on custom theming in jetpack Compose. How to implement and full guide.
    Thanks in advance