Hi, Cal! Thanks for your tutorial. I'd like to add a few things for beginners like me. From now, android ask POST_NOTIFICATIONS permission, you should add it on your manifest file. Notification didn't work on my emulator, so I tried many things. I added Log right after manager.notify() on Notification class, then I could find it's already working! Just allow notification of your app from settings on your emulator.
What a wonderful tutorial, thank you for posting it and thank you for being fast and u explained everything really well. Short concise and to the point, love it. Liked and subscribed instantly, keep making more and if I could request something maybe make a quick tutorial for a recyclerview with a header. Cheers
Thanks man, excellent job! The code is working perfectly! Just as a feedback, you are talking and coding/clicking really fast. I had to put you on 0.75 speed and sometimes still had to stop the video to see what exactly you were doing. In comparison for other youtubers I often have to speed up the video to 1.25 or 1.5. So maybe for your future videos try to slow down a bit. Otherwise keep up the greate work!
if I want to schedule multiple notifications then how we can do it for ex first at 1 pm and second at 1.10 pm then it only shows for 1.10 pm, not for 1 pm
Hey can you suggest me how can I cancel the notification before it is live. Actually I am creating task manager in which user can schedule a notification for a task but if the user completes that task before the notification is shown then I need to cancel the it. So is there any way ?
Hey, thanks for this tutorial, it was very useful. Just one question, is it possible to add an action (eg redirect to a certain app activity) when the user clicks the notification?
I cant import android.text.format.DateFormat.getLongDateFormat i wrote on import part but it says its unused. val dateFormat = DateFormat.getLongDateFormat(applicationContext) val timeFormat = TimeFormat.getLongDateFormat(applicationContext) this part gives error cuz of it and this part is gives error, when you hover over set text val calendar = Calendar.getInstance() calendar.!!!!!set!!!!!(year, day, hour, minute) i added exclamation marks to show you the part im talking about return calendar.timeInMillis on error it says None of the following functions can be called with the arguments supplied what can i do pls help
Hey your vid is very good. much appreciate it. but can you show us or upload the ActivityMainBinding class please? the class is not on your github and you didn't show it as well in your vid. thank you so much
02:15 when we enable view binding here. Then we access to activityMainBinding. medium.com/androiddevelopers/use-view-binding-to-replace-findviewbyid-c83942471fc
@@CodeWithCal ah alrigh thank you so much. by the way , it seems like NotificationChannel requires android 8.0 to run. is there any alternative solution to use notificationChannel below android 8.0 ?
Buddy is there any way that I can convert this into JAVA? It's really hard to do that. I need JAVA code for my project and no video on the internet works. Please help me...
This is fine in XML, but can anyone help me to create this datetime picker local scheduled notification with jetpack compose? Rarely jetpack compose has tutorials, and finding this topic with compose is impossible as of now !!.
This is about 6 months old but...I am trying to incorporate local notifications into one of my apps. I have the schedule notiification functionality in another class outside of MainActivity also. All works for me except I am not getting the intent extras. I either need to hard code them or they come in as null/empty string. I am not sure what the issue is but I am thinking it may have to do with the context I use from my class. I don't have application Context in my class. If you don't have a solution I can show you how I have it working.
Update...I figured out my issue....my request code in schedule Notification was a different number than the notification Id. once I set these to the same value it all worked.
Hi, thank you for this tutorial. Can you maybe explain how we can get the notification to repeatedly popup every Monday and Tuesday every week at 8 am for example?
@@CodeWithCal I'm not sure it would be that easy, 'cause it (as far as I am concerned) would not survive device reboots and also "Android might decide to shut down a process/app at some point, when memory is low and required by other processes that are more immediately serving the user. Application components running in the process that's killed are consequently destroyed. A process is started again for those components when there's again work for them to do. When deciding which processes to kill, the Android system weighs their relative importance to the user. For example, it more readily shuts down a process hosting activities that are no longer visible on screen, compared to a process hosting visible activities. The decision whether to terminate a process, therefore, depends on the state of the components running in that process."
@@imadkhallouk6998 I suppose scheduling a notification for next month or even a year isn't really a good idea, because android (as an OS) can put your task into sleep or even cancel your request (If the OS will require more processing power or memory) which will either delay your notification or it simply won't appear! There is also the issue with rebooting, safe modes etc. Based on my experience: the best way to schedule a long running notification is to schedule it every time the user opens the app (and of course cancel the previous notification request if it still exists)
@@dawidciubak9493 but if a want to make for example a reminder that every two days remember me that i need to watering a plant? how i suppose to do it ?
This is not my first comment that I leave, but again I will say that the tutorial is really cool. But i still have one more question: as I understand it, you tested the code on the 8th version of android, but now on the 12th android this code works only in one case: if the application is open in the background, so when you close an application in recent apps, then there are no notifications.(the code is exactly the same as in the video) Is there a way to fix this, maybe using a Service or something like that?
@@CodeWithCal one more small question: as I understand it, you tested the code on the 8th version of android, but now on the 12th android this code works only in one case: if the application is open in the background. Is there a way to fix this, maybe using a Service or something like that?
Waste of time. If any one find anything about like that which actually work, please let me know. I want to show notification at a selected time,app is closed or open no matter.
shows error public constructor Builder(p0: Context, p1: Notification) defined in androidx.core.app.NotificationCompat.Builder public constructor Builder(p0: Context, p1: String) defined in androidx.core.app.NotificationCompat.Builder
Thanks for the Tutorial Cal. I was planning on using WorkerManager but happened upon your video. Great solution!
I've jus discovere this channel and i loved so so much. Please keep continue to make tutorials. Some of us really need. Loves...
I will recommend this channel anyone i know interesting in programming.
Thanks for the kinds word. I'm glad you like the channel. I have been uploading less than I have in the past but I am no means done uploading videos.
The tutorial is simple and easy to understand. Thank you❤😊
Very useful tutorial. Thanks 😁
Wow! Good, thats, what I need for my project!
Hi, Cal! Thanks for your tutorial. I'd like to add a few things for beginners like me. From now, android ask POST_NOTIFICATIONS permission, you should add it on your manifest file. Notification didn't work on my emulator, so I tried many things. I added Log right after manager.notify() on Notification class, then I could find it's already working! Just allow notification of your app from settings on your emulator.
Hi Jaehun, I had the same situation like you, the notification did not come out, but I don't know how to solve it
What a wonderful tutorial, thank you for posting it and thank you for being fast and u explained everything really well. Short concise and to the point, love it. Liked and subscribed instantly, keep making more and if I could request something maybe make a quick tutorial for a recyclerview with a header. Cheers
Glad it was helpful! Thanks for kind words.
This boy is superhero ❣
Excellent tutorial
its working even app closed !! you're awesome buddy ,keep on :))
Thanks man, excellent job! The code is working perfectly! Just as a feedback, you are talking and coding/clicking really fast. I had to put you on 0.75 speed and sometimes still had to stop the video to see what exactly you were doing. In comparison for other youtubers I often have to speed up the video to 1.25 or 1.5. So maybe for your future videos try to slow down a bit. Otherwise keep up the greate work!
Thanks for the feedback. I am trying to scale it back a bit :)
if I want to schedule multiple notifications then how we can do it for ex first at 1 pm and second at 1.10 pm then it only shows for 1.10 pm, not for 1 pm
Hi, Thanks for the great Tutorial, do you have any tutorial for repeating alarms?
Thanks!
Excellent tutorial. Question.
How can I get the pending notifications generated by the application and delete them?
great video thank you for your help and can you tell us how to open activity from these notifications
Works for me
Java version?
Hi how can I open notifications to make it move me to a new tab?
Thanks for the great lecture
If I set it at 1:00 and then 1:05
the alarm will only go off at 1:05.
How can I set the alarm to go off multiple times?
hey i used your notification logic but i get my notifs late not as per scheduled
hi! thank you for the tutorial. I was wondering, how can the user delete the notification?
How can i make this code to also show a heads-up notification
This is only working for api level 23 and above. What about less than 23?
thank u, this tut is very helful. but i wonder that, by this method how we can set it push daily notification.
Great. So we can use some date / time has been stored in the database and reuse it for alert
I dont see why not
Hello, Can this notification also send schedules to other people or not?
Excellent tutorial, but when I restart the iphone the notifications are not shown, any solution?
Hello. Thanks for your video, it help me a lot
But I want to show head up notification and cancel it. How can I do that? Thanks
Hi when I try to run my app, it keeps saying the emulator was terminated. I’ve verified all proper sdk tools are setup, not sure what my problem is.
I'm not sure either. Did you figure it out?
Man, is it possible to schedule local notifications with days apart?
Hey can you suggest me how can I cancel the notification before it is live. Actually I am creating task manager in which user can schedule a notification for a task but if the user completes that task before the notification is shown then I need to cancel the it. So is there any way ?
I don't know any way of the top of my head.
What does Google / Stack overflow say on the matter?
For some reason the the notification isn't coming in fir me any help??
Hey, thanks for this tutorial, it was very useful. Just one question, is it possible to add an action (eg redirect to a certain app activity) when the user clicks the notification?
Yes it is possible, did you find a solution?
@@CodeWithCal Could you show how to do it please?
I cant import android.text.format.DateFormat.getLongDateFormat i wrote on import part but it says its unused.
val dateFormat = DateFormat.getLongDateFormat(applicationContext)
val timeFormat = TimeFormat.getLongDateFormat(applicationContext)
this part gives error cuz of it and this part is gives error, when you hover over set text
val calendar = Calendar.getInstance()
calendar.!!!!!set!!!!!(year, day, hour, minute) i added exclamation marks to show you the part im talking about
return calendar.timeInMillis
on error it says None of the following functions can be called with the arguments supplied
what can i do pls help
I think you just want
import java.util.Calendar;
or
import java.util.*;
Hey your vid is very good. much appreciate it. but can you show us or upload the ActivityMainBinding class please? the class is not on your github and you didn't show it as well in your vid. thank you so much
02:15 when we enable view binding here. Then we access to activityMainBinding.
medium.com/androiddevelopers/use-view-binding-to-replace-findviewbyid-c83942471fc
@@CodeWithCal ah alrigh thank you so much. by the way , it seems like NotificationChannel requires android 8.0 to run. is there any alternative solution to use notificationChannel below android 8.0 ?
call requires API level 26 this is the error
Buddy is there any way that I can convert this into JAVA? It's really hard to do that. I need JAVA code for my project and no video on the internet works. Please help me...
You can convert it to java its absolutely possible, Im not going to do it specifically for you though.
Do you know why notifications do not work for me when I close the application? And if I set 2 notifications, only the latter shows up :(
Ahh hard to debug without seeing the code, good luck!
Unresolved reference: submitButton, can you help me with that?
Sounds like an issue with some dependencies
you are giving an example of peractly managed codes
This is fine in XML, but can anyone help me to create this datetime picker local scheduled notification with jetpack compose?
Rarely jetpack compose has tutorials, and finding this topic with compose is impossible as of now !!.
Unresolved reference: ActivityMainBinding , Any solutions ?
02:15 have you enabled view binding and a gradle sync?
this code is working when I am using in Main Activity but when I use this in other activity it did not work even there is no error in code
Did you solve the problem?
This is about 6 months old but...I am trying to incorporate local notifications into one of my apps. I have the schedule notiification functionality in another class outside of MainActivity also. All works for me except I am not getting the intent extras. I either need to hard code them or they come in as null/empty string. I am not sure what the issue is but I am thinking it may have to do with the context I use from my class. I don't have application Context in my class. If you don't have a solution I can show you how I have it working.
Update...I figured out my issue....my request code in schedule Notification was a different number than the notification Id. once I set these to the same value it all worked.
Hi, thank you for this tutorial. Can you maybe explain how we can get the notification to repeatedly popup every Monday and Tuesday every week at 8 am for example?
I think all you would need to change is set a repeating alarm :)
@@CodeWithCal I'm not sure it would be that easy, 'cause it (as far as I am concerned) would not survive device reboots and also "Android might decide to shut down a process/app at some point, when memory is low and required by other processes that are more immediately serving the user. Application components running in the process that's killed are consequently destroyed. A process is started again for those components when there's again work for them to do.
When deciding which processes to kill, the Android system weighs their relative importance to the user. For example, it more readily shuts down a process hosting activities that are no longer visible on screen, compared to a process hosting visible activities. The decision whether to terminate a process, therefore, depends on the state of the components running in that process."
@@dawidwitkowski2111 And what are you recomed to use to do what @Taoui Chaimaa said?
@@imadkhallouk6998 I suppose scheduling a notification for next month or even a year isn't really a good idea, because android (as an OS) can put your task into sleep or even cancel your request (If the OS will require more processing power or memory) which will either delay your notification or it simply won't appear!
There is also the issue with rebooting, safe modes etc.
Based on my experience: the best way to schedule a long running notification is to schedule it every time the user opens the app (and of course cancel the previous notification request if it still exists)
@@dawidciubak9493 but if a want to make for example a reminder that every two days remember me that i need to watering a plant? how i suppose to do it ?
Oi, amigo. Não funcionou de um dia para o outro.
This is not my first comment that I leave, but again I will say that the tutorial is really cool. But i still have one more question: as I understand it, you tested the code on the 8th version of android, but now on the 12th android this code works only in one case: if the application is open in the background, so when you close an application in recent apps, then there are no notifications.(the code is exactly the same as in the video) Is there a way to fix this, maybe using a Service or something like that?
What does Google say about the different versions of Android? Maybe they want us to do it a different way now? I'm not sure..
@@CodeWithCallooks like it. I'm trying to figure it out now. If I can figure it out, I'll write.
Awesome tutorial, but i have one question. Is there any way to do the same thing on Java?
Absolutely, you could do this in Java :)
@@CodeWithCal yeah, my bad, I forgot, that there is an integrated Kotlin to Java converter in Android Studio :D
@@CodeWithCal one more small question: as I understand it, you tested the code on the 8th version of android, but now on the 12th android this code works only in one case: if the application is open in the background. Is there a way to fix this, maybe using a Service or something like that?
sorry, how to push notification interval day with time set
www.pubnub.com/tutorials/push-notifications-android-kotlin/
@@CodeWithCal thanks
wow amazing, but how did you learn all that?
😋
API level < 21???
Why would you be making an app in 2023 which such a low API?
Waste of time. If any one find anything about like that which actually work, please let me know. I want to show notification at a selected time,app is closed or open no matter.
way too fast for anyone to follow.
:P
Waste of time
shows error
public constructor Builder(p0: Context, p1: Notification) defined in androidx.core.app.NotificationCompat.Builder
public constructor Builder(p0: Context, p1: String) defined in androidx.core.app.NotificationCompat.Builder