Several years ago i developed android app that created alarm clock at certain time when some notification was received. Android programming is complicated they keep changing things make it more difficult for apps to run in background ect.
So for sending notifications i use viber bot which works fine for messages. The problem is that sometimes i want to send an alert (ringtone/music) that last at least 30 seconds since I am sleeping at that time and might not hear simple notification. I know i could change ringtone for viber, but i would like to use it for different purposes with normal notifications. What would work is to set custom ringtone only for certain viber bot but from my understanding this doesn't work. Making a voice call would work but from my understanding this is not possible from command line at least not for free.
I found googles function "locate my phone" that start a ringtone but i didnt find if i can do it outside of web browser. So basically i am searching for a way how i can send command from my linux server that would start ringing on my phone and other people's phone that give me permission.
Any idea ?
Finally I manage to solve this by using using Telegram android app and python script https://github.com/alexander-akhmetov/python-telegram to make a call.
So it turns out that Huawei phones with 5.1 can't display MediaStyle notifications so while fixing that, I made a very simple notification test and I get a strange question asking Allow App Name to push messages to the notification panel.
I don't use push in any way, in fact the screenshot below is for an app that all it does is show a sample notification, nothing else.
How can I make it not show that?
This is the code:
Notification notification = new Notification.Builder(getApplicationContext())
.setSmallIcon(R.drawable.ic_launcher_background)
.setContentTitle("Track title")
.setContentText("Artist - Album")
.setOngoing(true)
.addAction(R.drawable.ic_add_black_24dp, "fwd", pi)
.addAction(R.drawable.ic_android_black_24dp, "fwd", pi)
.addAction(R.drawable.ic_archive_black_24dp, "fwd", pi)
.addAction(R.drawable.ic_arrow_back_black_24dp, "fwd", pi)
.addAction(R.drawable.ic_aspect_ratio_black_24dp, "fwd", pi)
.addAction(R.drawable.ic_fast_forward_black_24dp, "fwd", pi)
.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.vectors_525058875))
.setAutoCancel(false)
.build();
notificationManager.notify(300, notification);
This is the screenshot.
What am I doing wrong? I tried taking out all the actions, that didn't help. Took out title and context, that didn't help. Took out large icon, auto cancel, ongoing, etc, didn't help.
Please note that I am not using Push in any way and this doesn't seem to be related to that. Also I a using the support compat libraries to make my notification but on this example I didn't just to make sure that wasn't the issue.
Huawei's version of the Android OS has a custom feature that tries to spot apps doing annoying numbers of notifications.
Don't focus on the word "push". It doesn't mean "push notifications" in the technical sense of coming from the internet. It just is a verb, they could have said "allow app to create notifications" or "allow app to cause notifications" it's the same meaning.
Anyway, this is an OS feature, there is nothing you can do to avoid it except make sure you aren't spammy with your notifications. Unfortunately during development and testing you will often be triggering a lot of notifications, and the OS will detect your app is spammy. Don't worry about it. As long as your app works well for normal users it shouldn't happen.
It's Huawei customized Android OS feature. Long story short, you can't disable it.
I saw it a lot when I test my app. Huawei OS thinks your notification might annoy the end user(yourself, in this case) because it happened a lot.
You don't have to concern it๐
Your use deprecated constructor. Your must specify channel. Like this:
Notification.Builder builder = new NotificationCompat.Builder(context,"MyPerfectApplication")
Otherwise you use unknown chanel, possible you try to push in system channel.
it's indeed a custom check of EMUI, which enables the user to decide whether or not to have these custom notifications being pushed into the default notification channel, before a single one of these notifications had ever been displayed, when the first push is being attempted. it generally controls the notification settings of your app on Huawei devices, from within that notification panel. system & vendor applications are permitted to push notifications by default and therefore it won't ever ask the user for a double confirmation there. this has nothing to do with excessive notifications, because it is a precondition to even have these notifications pushed, no matter the amount.
Trying to stop "Kijiji" from making noise every time I get a reply but the app has no way to disable the notification sound.
Any way to disable the notification sounds via ADB? I know you can disable vibration for specific apps so I think you can disable notification sounds also.
I need to monitor the status of the notification LED on an android device. I've seen several post that explains how to customize the LED behavior (i.e. Changing LED color for notifications) however I would like to receive an event (using a receiver) whenever the LED changes its status or an app triggers a blink, regardless of which app caused the blink.
Is it possible to receive these event?
If yes, which intent filter should I use to receiver this kind of event?
Thanks!
Is it possible to receive these event?
Definitely not in the Android SDK. A custom Android build packaged as a ROM mod may be able to determine this, at least for OS-triggered uses of the LED. System-level use of the LED (e.g., charging status) may not be visible to Android at all.
I have created a broadcast receiver that uses the SMS_RECEIVER. So far everything works fine with it. Now I would like to modify the notification settings for the sms e.g. adjust volume, turn on vibrate, change audio file...
Basically, I would like this app to duplicate the custom ringtone notification. So I would get the sms, check the senders phone number, and change the notification accordingly. I'm having trouble finding documentation on how to do this per text message. Could someone please link me to some documentation or a code snipet of how to do this?
(I found an example on how to silence the phone but the problem with that example is the phone will remain silenced until the code/user turns the volume back on. I would like to only perform the action on the text message being received at the time, this way it will not affect other functionality of the phone)