I would like to write a simple app which can manage the default SMS notification by assigning a specific sound to a specific user. In my intention this app would only do this (so it's not a complete replacement of SMS app) and let the user handle sms with the default SMS App.
So it simply turns into the ability to override programmatically the sms notification sound when one is received. The notification sound are stored on the SD card. I tried couple ways to obtain this but until now no success:
Using RingtoneManager.setActualDefaultRingtoneUri() inserting tone into ContentResolver leads me to some annoying issues. First when added to database, the new ringtone appears in the sound list and second, once the notification is overridden using RingtoneManager.setActualDefaultRingtoneUri(), I'm not able to roll back to the default notification sound and in particular I don't know WHEN doing it!
Creating a Notification object and using PreferenceManager class but facing similar problems as written above (WHERE override the sound and WHEN doing it).
Thank you all in advance.
Related
I have a bunch of notifications for new messages (MessagingStyle, one notification contains one or more messages with the same user), and I want to play sound when a new message arrives now. Sometimes I want to update the notification silently, though. For instance:
On system boot up, I want to present old messages to the user without sound
When the application is not connected, I want to update the notifications to remove the “Reply” button, and vice versa
When an application receives a message that was posted some time in the past, I don't want to alert the user as they may have read the message elsewhere.
It works fine on L but Oreo seems to be playing sound for every notification fire or update. Is there a way to work around this behavior?
My server is able to send FCM push notifications to my Android app users. The notifications are successfully delivered with default notification sound.
However, I want the app user to select sound from Ringtone Picker in the Preference screen.
I have been able to show Ringtone Picker in the Preference screen, but I don't know how to set the selected sound URI for future push notifications
So that when the future push notification of this app is received, the sound that user selected, should be played.
Please advice
Try using this? I assume in your app you are dealing with this class and library.
https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html#setSound(android.net.Uri)
i have read for hours about how to start play a sound the way i want
but i cannot find an answer.
Here goes,
When device receive a C2DM push im displaying a Notification.
User can click the Notficationand my activity start.
Everything works grate.
Now I would like to create a phone-call-type of ring-sound
so it sounds like there's an incoming Voice call.
User pick up phone and notice my Notification presses it
and the sound stop playing.
Or even better, the C2DM message trigger my activity to start
with a phone-call-type of ring-sound.
When user touch the phone the sound stop playing
any help in any direction would be grate
Set the sound data member of your Notification to a Uri pointing to the ringtone you want to have played when the Notification is displayed. Ideally, you let the user pick their own ringtone (e.g., via a RingtonePreference) rather than forcing a certain ringtone on them.
Or even better, the C2DM message trigger my activity to start with a phone-call-type of ring-sound.
Popping up an activity like this, when the user might be in the middle of something else, is infrequently a good idea.
What I am trying to do is developing an SMS notification system for our own application, whenever the sms is received from a specified number the application gets invoked but the problem is that whenever the sms arrives from any other number then also the application gets invoked and that is undesirable. I would be grateful to hear from u all .
Read this question and answers: how to stop the application from opening in android
Basically you need to extract the number from the message and if it is a number you are interested in, then you start your application, otherwise not.
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)