PeterKingori / My-Car-Maintenance

An app for users to keep track of their vehicles' maintenance and repairs.
https://play.google.com/store/apps/details?id=com.pkndegwa.mycarmaintenance
8 stars 3 forks source link

How to add a reminder for "next service date" #2

Closed raihansani closed 1 year ago

raihansani commented 1 year ago

Greeting from Malaysia, my name is Raihan and im a new dev with 0 experience. I really really like your project. Recently i learn about alarm manager. I try to add a reminder for next service date so the user can get a push notification by next service date but the app keep crashing. I dont want to giveup so i try to reach you if you could help. If you consider to update your project please let me know.

PeterKingori commented 1 year ago

Hi Raihan. Thanks for using my project. I haven't yet added a reminder for the next service date. I wanted to first add a separate screen for a user to add reminders and get that to work. I have worked on it for about 2 weeks and it still has bugs. When I sort that out then I can use the same functionality for the next service date. I have pushed the changes I have been making. You can also read these articles and see if you get a working solution, then tell me when you do.

  1. Everything you need to know about adding Notifications with Alarm Manager in Android - this one is a bit hard for me because it uses dependency injection which I haven't learnt yet.
  2. Android AlarmManager As Deep As Possible
PeterKingori commented 1 year ago

Hi Raihan. I forgot to send this link of a Google codelab on notifications. This is where I got my original code from. Advanced Android in Kotlin 01.1:Using Android Notifications

raihansani commented 1 year ago

Hi PeterKingori, thank you for your email. Glad you give this to me. Recently i have done creating an alarm manager but seem odd it does not functioning even there is no bug/error. I will try this method hopefully it will working. I will keep in touch with you.

On Mon, 23 Jan 2023 at 15:44, Peter @.***> wrote:

Hi Raihan. I forgot to send this link of a Google codelab on notifications. This is where I got my original code from. Advanced Android in Kotlin 01.1:Using Android Notifications https://developer.android.com/codelabs/advanced-android-kotlin-training-notifications#0

— Reply to this email directly, view it on GitHub https://github.com/PeterKingori/My-Car-Maintenance/issues/2#issuecomment-1399923687, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4ERK6UMKUEDML7MSGAL5Z3WTYZE5ANCNFSM6AAAAAAT3FRNEU . You are receiving this because you authored the thread.Message ID: @.***>

PeterKingori commented 1 year ago

Hi. The Google codelab works but I'm having challenges using it in my project. I hope it works for you.

PeterKingori commented 1 year ago

Hi Raihan. I think I have fixed the issue in the RemindersViewModel and AddReminderFragment so that the correct date and reminder message is sent to the AlarmReceiver. Try it and let me know if it works. I haven't yet added the functionality for the "next service date".

raihansani commented 1 year ago

Hi Peter, i have seen your latest update, i like the way you create a navigation at the bottom and separate the reminder and . I have try it following the codelab and it work for me. Almost same as yours but i add my reminder inside servicelistadapter. So when you drop down the service, it will have a reminder section. 😄

On Thu, 26 Jan 2023 at 02:11, Peter @.***> wrote:

Hi Raihan. I think I have fixed the issue in the RemindersViewModel and AddReminderFragment so that the correct date and reminder message is sent to the AlarmReceiver. Try it and let me know if it works. I haven't yet added the functionality for the "next service date".

— Reply to this email directly, view it on GitHub https://github.com/PeterKingori/My-Car-Maintenance/issues/2#issuecomment-1404030499, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4ERK6XSXRGU7WG2IFZNKTLWUFUF3ANCNFSM6AAAAAAT3FRNEU . You are receiving this because you authored the thread.Message ID: @.***>

raihansani commented 1 year ago

Hi Peter, i have seen your latest update, i like the way you create a navigation at the bottom and separate the reminder and other page. I have try it following the codelab and it work for me. Almost same as yours but i add my reminder inside servicelistadapter. So when you drop down the service, it will have a reminder section. 😄

On Thu, 26 Jan 2023 at 02:11, Peter @.***> wrote:

Hi Raihan. I think I have fixed the issue in the RemindersViewModel and AddReminderFragment so that the correct date and reminder message is sent to the AlarmReceiver. Try it and let me know if it works. I haven't yet added the functionality for the "next service date".

— Reply to this email directly, view it on GitHub https://github.com/PeterKingori/My-Car-Maintenance/issues/2#issuecomment-1404030499, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4ERK6XSXRGU7WG2IFZNKTLWUFUF3ANCNFSM6AAAAAAT3FRNEU . You are receiving this because you authored the thread.Message ID: @.***>

PeterKingori commented 1 year ago

Hi. Thanks. I'm glad the codelab worked for you. Your idea sounds nice :smile:. Please send me an image I see.

raihansani commented 1 year ago

Sorry for late reply, im not feeling well yesterday. Sure can, i put the reminder inside the service list adapter to make it simple for the user. But the problem is that user cannot see what they put as a reminder 😂

On Thu, 26 Jan 2023 at 13:52, Peter @.***> wrote:

Hi. Thanks. I'm glad the codelab worked for you. Your idea sounds nice 😄. Please send me an image I see.

— Reply to this email directly, view it on GitHub https://github.com/PeterKingori/My-Car-Maintenance/issues/2#issuecomment-1404588600, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4ERK6RUSIBM5R4E7LJQJA3WUIGJDANCNFSM6AAAAAAT3FRNEU . You are receiving this because you authored the thread.Message ID: @.***>

PeterKingori commented 1 year ago

Hi. I hope you're feeling better. Maybe you can figure out how to add the reminder to the reminders screen once it's added. Maybe by using the same viewmodel or getting the data from the database.

raihansani commented 1 year ago

On Fri, 27 Jan 2023 at 1:38 PM, Peter @.***> wrote:

Hi. I hope you're feeling better. Maybe you can figure out how to add the reminder to the reminders screen once it's added. Maybe by using the same viewmodel or getting the data from the database.

— Reply to this email directly, view it on GitHub https://github.com/PeterKingori/My-Car-Maintenance/issues/2#issuecomment-1406044913, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4ERK6W7Z4T3MCIWZ3LZ4UDWUNNPHANCNFSM6AAAAAAT3FRNEU . You are receiving this because you authored the thread.Message ID: @.***>

Thank you Mr. Peter, yeah i have to create a new page to pass the data for reminder, it will have no issue since the reminder are not bind with any vehicle or service database. Alright, Thank you so much Mr Peter for your knowledge. I really appreciate it, its kinda hard to find someone willing to help especially in kotlin/Java community. Wishing you all the best in the future.

If you seeking idea to improve your app, i think putting a Map API would be great. User can find nearest workshop around them. 😄😁

PeterKingori commented 1 year ago

Thank you as well Raihan, and you're welcome. The MAP API is a great idea. I'll add it to the list of features I wish to add in future and see if any users bring it up once it's on the Play Store. I wish you the best as you continue learning and developing more apps.