tsteward Well-Known Member Licensed User Longtime User Jul 13, 2020 #1 I have never created a service type app before and was wondering if someone had a sample I could follow. What I am trying to achieve. I have an app GridConnect that monitors a reed switch sensor in my smart home system. When the Garage door opens I get a notification When it closes I get another notification I want to write an app that deletes the notifications (I can turn them off but that would defeat the purpose), starts a timer when the door open notification is received and if the door closed notification is not received within say 5 minutes it alerts me somehow. Attachments Screenshot.jpg 421.5 KB · Views: 402
I have never created a service type app before and was wondering if someone had a sample I could follow. What I am trying to achieve. I have an app GridConnect that monitors a reed switch sensor in my smart home system. When the Garage door opens I get a notification When it closes I get another notification I want to write an app that deletes the notifications (I can turn them off but that would defeat the purpose), starts a timer when the door open notification is received and if the door closed notification is not received within say 5 minutes it alerts me somehow.
Erel B4X founder Staff member Licensed User Longtime User Jul 14, 2020 #2 Start with the example: https://www.b4x.com/android/forum/t...ry-notificationlistenerservice.35630/#content Upvote 0
Start with the example: https://www.b4x.com/android/forum/t...ry-notificationlistenerservice.35630/#content
tsteward Well-Known Member Licensed User Longtime User Jul 14, 2020 #3 Yes I have run the example and I can read the text of the notification. I have no idea how to set up triggers to check the notifications every X seconds. I assume i need to. No idea how to start a timer and react when time is up or cancel the timer if the close notification is sent. App should run in background and popup if time between open and close notifications is too long. Clueless Upvote 0
Yes I have run the example and I can read the text of the notification. I have no idea how to set up triggers to check the notifications every X seconds. I assume i need to. No idea how to start a timer and react when time is up or cancel the timer if the close notification is sent. App should run in background and popup if time between open and close notifications is too long. Clueless
DonManfred Expert Licensed User Longtime User Jul 14, 2020 #4 tsteward said: I assume i need to. Click to expand... No. The notifications will also be handled when your app is not running. The service will first be created. Click to expand... Upvote 0
tsteward said: I assume i need to. Click to expand... No. The notifications will also be handled when your app is not running. The service will first be created. Click to expand...
tsteward Well-Known Member Licensed User Longtime User Jul 15, 2020 #5 Scratch that idea I can't make it work. Thanks anyway Upvote 0