Android notifications - Page 1
Forum section: electronics / general

author: PlainName
author_rank: Super Contributor
timestamp: July 27, 2023, 07:14:36 pm
content: If there is a more appropriate forum to ask this, please point me at it.I want to write a phone app to intercept Android notifications and send selected ones to a device over Bluetooth. The device may respond with a cancel command, and the app should then acknowledge the notification to a) stop it notifying, and b) allow subsequent notifications. If this sounds very much like the way a watch moght work, that would be an excellent example of functionality (although it isn't a watch, and only notifications are required - no voice, dialling, gps, etc). And it doesn't want to be a 'wear' app - just hit Bluetooth as directly as possible.There is a snag: I know nothing whatsoever about Android programming, so my query is how should I go about achieving the app? I am happy to use an existing one, but I doubt one exists and I will need to do my own thing. Where to start, and which route to take?

author: JPortici
author_rank: Super Contributor
timestamp: July 30, 2023, 05:30:34 am
content: Probably not going to be easy, but i believe it's possible.I see that Android has a "Notification Listener" component, but i don't undertand if it can get all notifications, or only those posted by your applicationIf you have no experience i suggest you use one of those frameworks to build app, they remove a lot of the complexity in getting started, building layouts and entering into the mindset of the maniacs that created the official tools. Poor souls.Plus, for anything that is not this platform specific you get multiplatform support.Plus, they don't radically change every couple of years, when the maniacs that mantains the official tools change. Seriously, if you find a tutorial or course make sure it's from the previous two years or newer, or you won't be able to follow with the current tools.The framework that i use is called "Basic 4 Android", it is really easy to get started, there are a lot of official libraries (unlike flutter which a few months ago still relied on "the community" for most libraries and libraries support, most libraries were junk. I tried five different BLE and each had problems that made it useless). The community is one of the best i've ever seen, the power users there are really knowledgeable and willing to help, and 99% of the time the first one to answer is going to be the creator of the project with just the words you were looking for. The documentation is always up to date.What i suggest is that you pick one of these frameworks, and go by steps. Open one example project (a tutorial from the forum) and see how it's built. Start with your own application to get used to building the layout and making things work. Add the BLE component and connect to the BLE device and interact with it. Add the notification listener library/component and play with it, see how to change other applications notification settings (that's going to be the hardest part. I believe it's possible though)

author: PlainName
author_rank: Super Contributor
timestamp: July 30, 2023, 09:07:40 am
content: QuoteYeah, I think that might be an understatementQuoteAh! I think I purchased that many, many years ago when it was being offered cheap. Had great plans and then did something else, as you do. I'll dig that out and see how it goes.Thanks for your suggestions

author: Shonky
author_rank: Frequent Contributor
timestamp: July 30, 2023, 09:25:47 am
content: There are a number of apps that "repeat" Android notifications to other devices so what you're suggesting is quite feasible. I can't help with the mechanisms for doing that but look at apps like Pushbullet and Join. They also allow responding to the notification remotely similar to what you suggest.

author: PlainName
author_rank: Super Contributor
timestamp: July 30, 2023, 09:33:29 am
content: Pushbullet is a new one on me, but my watch and satnav do this too and make a jolly good job of it. Seems to be getting quite common!