NotificationListenerService driving me nuts - Java for Android App Development

Okay, I'm working (and already release in beta) a app called notify which essentially allows to forward notification and call-events to other clients (Kodi aka XBMC is the only available client right now)
The problem:
As the title says, I'm using the NotificationListenerService which is driving me absolutely nuts. The problem is best explained with a "simple" example using e.g. a mail-app as reverence:
You receive a mail (the very first notification) which triggers onNotificationPosted with a StatusBarNotification object (which has a id, timestamp etc.)
WITHTOUT removing the first notification, you receive a second mail. This causes the mail app to:
Create a group (with the first and second notification) so wearable devices can properly display all notifications in form of a stack
Create a summary notification on the phone to display "basic" information's regarding both mails
This causes the onNotificationPosted to triggered multiple times with:
The very first email (now with different id, timestamp etc.)
The second email (The only thing I'm really interested in)
The summary notification
My problem is that I have no way of telling what the actual new notification is as the id AND timestamp of the first mail changed.
There is no real need of sharing my source as it is the most basic implementation of androids NotificationListenerService anyway (like really I only implemented the onNotificationPosted and onNotificationRemoved and forward the StatusBarNotification-object to another class which sends it to all clients)
I don't even use a BroadcastReceiver to communicate with the UI thread as I don't need the UI thread
I really hope someone knows what's up with that as I spent literally month without being able to get around this :/

Related

Password saver + sms notify + sms delivery notify

hi everybody. i've a few questions about my tytn (in perfect working order since i bought it 20 days ago):
1. where are saved the password filled in internet explorer?
2. i don't know why when i receive an sms, the device doesn't show it on the bottom of the diplay anymore. as default, it shown the sms preview, now it doesn't work...
3. tonight the sms delivery request has turned on by itself, without touch anything... why?
thanks for any answers
any answer, please?
1. In registry at HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Passwords
Note that it keeps them per "realm", meaning, if you have different servers with different login/passwords pairs, but the servers have the name area names, it will try to use one and the same password. Sometimes good, but in general I'd call it a bug.
do you know also where the pre-formed phrases found in the "object" field creating a new calendar appointment are stored? I'd like to add the very useful personal appointments, like my martial arts lessons or other stuff

Custom Email notifications - possible?

Our Blackberry's have a way called "Level 1 Messages" to react differently to incoming emails based upon Sender and/or Subject text. This can include playing a different notification alarm and/or vibrating.
I'm trying to implement the same functionality into our new Cingular 8525 devices (WM5) and I'm not having much luck.
I've tried working with the POOM (Pocket Outlook Object Model) and it seems that doesn't cover incoming emails.
I then tried looking into MAPI and it seems that Messaging related issues only deal with SMS messages. We receive our Exchange email via Activesync over OWA (I think) and so that leaves MAPI out.
I am both amazed that this is that difficult and amazed that there aren't 500 questions related to this already here as I thought this would be a VERY common need.
If I can't figure this out, we'll have to go back to Blackberry and that's not what I want to do.
I looked at the software phoneAlarm and it supposedly has this functionality but it is very unstable and we could never get the Custom Email alerts working.
TIA - any help at all will be greatly appreciated.
Yes, I searched first and followed all those goose chases but I still have not found a working solution.
try the new phonealarm from pocketmax.net. it offers custom email and smsalarms by sender or content
sebi112 said:
try the new phonealarm from pocketmax.net. it offers custom email and smsalarms by sender or content
Click to expand...
Click to collapse
Well, as I stated in my post:
techstyled said:
I looked at the software phoneAlarm and it supposedly has this functionality but it is very unstable and we could never get the Custom Email alerts working.
Click to expand...
Click to collapse
I actually got the Custom Email alerts working. The problem I was having is that his "Contains" process only works if the searched for word is bounded by spaces... which is a very poor method. For example, we have an established procedure at our work for proceeding all mission critical messages with the word "critical -" and then the subject. But, since that first word isn't proceeded by a space, he doesn't trigger on that. I would have to get my work to agree to change to " critical -" (note the all important proceeding space).
That's just stupid, IMO.
And until he fleshes out his program a bit more, I'm going to have to find an alternative.

Notification of new email

Hi,
I use my HD2 with exchange synchronisation. It works well with one big problem!
My Exchange sorted the incoming mails to several folders. The problem is that I only get a notification if a mail is incomming directly to the main folder of my mailbox. If a mail was sortet in a subfolder there is no notification. Is there a reg tweak or something else to learn the HD2 to beep every time when a new mail arrives?
It would be great if this is possible, because currently i have to look to all folders the see if there is a new mail.
Ghostraider
Same here...
I love to know a way to do a new mail notification on 'folders' too. However, I recall it did this on my iPhone too, so I'm not holding out too much hope!
Does no-one have a solution for this - it's driving me nuts ! The only thing that I've found in my searches on the 'net is the something from blackmonlabs called message-notify (I can't post the URL due to restrictions in this forum, but Googling it should turn it up)
This would work, but is going to screw up the lovely home page of the HD2, so is not really practical. What I'm looking for is something that will display a count of ALL unread messgaes irrespective of whether they are in the Inbox or have been automatically moved to a subfolder. Obviously this should be displayed in the Email notification icon.
If anyone can come up with a solution, I (and many others judging by what I'm reading elsewhere) would be very grateful !

request for rules-based email alerts

I know I'm not the only one that wants this...
Being an admin my box is constantly filled with stuff that I really don't want to wake me at 3am. However, when an outage or other high priority alert comes through, it would be AWESOME if I could alert on only those messages, or have a different alert for them.
Any chance that anyone is working on an app that would let the user specify an alert based on an email rule or filter? This is one I'd pay for gladly.
+1
million
You want to know the really sad thing about this?
10 years ago I had a Motorola PageWriter 2000 (2way pager) that could do this right out of the box. Now here we are with the most advanced pocket computers ever seen and I can't even set a simple mail rule for a different alert.
What gives?
I'm pretty new to Android, so I hope someone will correct me if I'm wrong, but I looked into this briefly today. Unfortunately, it could be a little tricky since email is handled at the application level and Android does not provide a "new email" broadcast message for an app to listen for. This type of service would almost have to work with the email client, but since there are many different clients that a user may have installed, it gets complicated quickly.
I never said it had to be a bolt-on app. There's more than one way to skin that cat.
Assuming that the standard mail app included with the OS is also open source, take the base code for the email app, add alert rules, then replace the standard mail app with the newly upgraded one.
Another solution (and this would be uglier and perhaps not do-able) would be to insert some sort of proxy app between the email app and the outside where alert filtering could take place before the message even passes to the email client. This would allow you to use whatever client you liked. Just disable the alert on the client and let the proxy handle the alerts.
Just ideas. Surely someone can make this work.

GChat on desktop with phone nearby

Has anyone cracked the code on when Google chat on the phone ignores desktop chat and when it doesn't? I have seen that sometimes when I chat with my friends on my desktop, sometimes my phone beeps for every line entered by the other party and sometimes it doesn't. I think in a perfect world, the phone should beep for the "first" line of text, and if I answer on the desktop, it should ignore the rest (but still record them for posterity). And if I answer on the phone, perhaps it should just haptic vibrate for each line of text received after the "first". I say "first" in quotes because I imagine that would be difficult to manage pragmatically. When is it the first chat of a new "session", and when is it just a delay in between chat lines of the same session? Maybe a customizable interval, like say five minutes. If no text is received within five minutes then it is a new session, so beep on the first line?
Lat night I was chatting with a friend (I was on the desktop) and every time he sent something, my phone would beep. Not the best solution in my opinion.
From what I can tell, your phone will receive the message when you do not have the gchat window active on your desktop.
If you click in on the area like you were going to type a message and leave your cursor there, when your friends send messages they don't seem to get sent to the phone. On the other hand, even if you have gchat open on your desktop and you say use a different program or are on a different tab in your browser, then your phone will receive the messages.
At least this is my experience. I think this is the correct behavior as you don't need to get messages in two places when you are actively chatting.
From my experience I use Gchat on my pc everyday when i am at work and I have my phone on my desk near by. When a friend of mine messages me it hits both for the first message, but if i answer on my desktop, it does not hit my phone ever until I sign off of gchat on my pc. Even if it is not focused on the gchat window. I am however using Trillian for my gchat, not sure what you all are using.
DLarva said:
From what I can tell, your phone will receive the message when you do not have the gchat window active on your desktop.
If you click in on the area like you were going to type a message and leave your cursor there, when your friends send messages they don't seem to get sent to the phone. On the other hand, even if you have gchat open on your desktop and you say use a different program or are on a different tab in your browser, then your phone will receive the messages.
At least this is my experience. I think this is the correct behavior as you don't need to get messages in two places when you are actively chatting.
Click to expand...
Click to collapse
This is what happens for me as well. Messages go to my phone on the first IM or if I don't have that window active on my desktop.
I am using the built-into-gmail-dot-com google chat. This has definitely happened to me several times before. Last night it happened again. The entire conversation I had with my friend, every time I received a message on my desktop, my phone also beeped. Other times it worked like it was supposed to (beeped the first time and that was it.)
I will see if I can get my wife to help me troubleshoot tonight.
perhaps a topic for a different thread...
I found the chat behavior to be exactly the way DLarva stated:
DLarva said:
From what I can tell, your phone will receive the message when you do not have the gchat window active on your desktop....
Click to expand...
Click to collapse
My question (perhaps a dumb one ) is how/where to turn off the notification that you got a chat all together?
I don't want any notification of a chat receipt while I am on the phone.
Any help?
Maybe:
Try (within setting of google talk) turn off notification bar, no vibrate, and set ringtone to silent.
That might approximate no notification.
etaChase said:
I found the chat behavior to be exactly the way DLarva stated:
My question (perhaps a dumb one ) is how/where to turn off the notification that you got a chat all together?
I don't want any notification of a chat receipt while I am on the phone.
Any help?
Click to expand...
Click to collapse
thanks for that - have tried to "approximate" no notification, and that's all well and good. . . but not the same as turning it off.
I have looked around in my mobile settings in the google account but can't find it (thought it might be similar to turning on/off notification of appointments in the calendar)...
might just be missing it, but this seems like fairly simple feature. I am nearing feeling ready to root my phone and thought maybe this would be a feature that was only available after doing that. It would have been the final encouragement I need to take that (admittedly not very big) plunge!
I have a rooted Nexus One (CM6 with KOR) and that is as close as I can get to turning them off (that I can find anyway).
This was happening to me, too (when I used Gtalk on the PC, the phone sitting on my desk would sound the alert, with every chat message I rec'd) -- so I just manually signed out of Gtalk on the phone, and it stopped happening. I mostly use Gtalk on desktop anyway. (Though when I check "running processes" on the Vibrant, I see Gtalk always seems to be running -- must start up automatically -- even though I'm signed out...)
exactly Pevvy -
but signing out of Gmail kinda defeats the purpose of having the phone constantly synched. Guess the same argument could be made as to why you want chats saved/synched... anyhoo - I just don't want chat on my vibrant, period. I don't want them saved (so transcription is turned off in gChat on the desktop) and I would never chat from the phone. OK, never say never, but I would rather have to enable that, rather than always having it running using resources.
When I root that would a fun thing to explore to see if it can be deactivated through some custom start-up (so it doesn't show as a running service - I see the same thing) and only starts if I manually start it.
That said, if it is server side associated with the google account (its a hosted domain and that may further change things...) it may not be able to adjust even with root. Interest how this shows the blending/blurring between the net and the synch to the phone - and should data and synch be more push or pull.
Oh, I didn't sign out of Gmail on my phone -- just Gtalk (the chat service)... seems it was keeping me signed in automatically before, and I had to go into the app, and manually sign out.

Categories

Resources