Notification.Vibrate = False Not Working

Status
Not open for further replies.

HimeAnator

Member
Licensed User
Longtime User
I'm setting a notifications vibrate setting to false and on my HTC Thunderbolt it works but on my Samsung Stratosphere it does not. It starts vibrating like crazy.

I'm using this code..
B4X:
Dim n As Notification 
n.Initialize
n.Icon = ""
n.Vibrate = False
n.Sound = False
n.Light = False
n.Insistent = False

Is there something I'm missing or another way to fix this?
 

barx

Well-Known Member
Licensed User
Longtime User
Upvote 0

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
@HimeAnator - Did you ever solve this problem? I'm testing on a Samsung Stratosphere (SCH-I405) and am having the same problem. Every time I display a notification I get a series of vibrations (1 long, 2 short, 1 long, 2 short), it doesn't matter what value I set "Vibrate" to, the basic code is:
B4X:
foRegularNotify.Initialize
foRegularNotify.AutoCancel = True
foRegularNotify.Icon = "icon"
foRegularNotify.Insistent = False
foRegularNotify.Light = False
foRegularNotify.Number = 2
foRegularNotify.OnGoingEvent = False
foRegularNotify.Sound = False
foRegularNotify.Vibrate = False
foRegularNotify.SetInfo("My Application Notification", "There are " & iNumNew & " new items to view.", Me)
foRegularNotify.Notify(1)
I have tried both the "built-in" notification object as well as Barx's library and they behave the same.

Interestingly, this is the same vibration pattern I get when I launch the B4A Bridge application on the Stratosphere as well. I have attached a sample program if anyone else can try to replicate this for me, or if they have any suggestions to suppress the vibrate.

Thanks in advance,
- Richard
 

Attachments

  • Notify.zip
    6.2 KB · Views: 301
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
if you download and install the demo app for my library and disable vibrate on that, then activate the notification. does it vibrate?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Their behave the same; they both dont vibrate on my Device (Samsung Galaxy Note 3. android 4.4.2)
 
Upvote 0

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
Yes, the demo app does vibrate even when set for no vibrate (same pattern, 1 long, 2 short, 1 long, 2 short). I tried being clever and setting a custom vibrate as well:
B4X:
foNotifyBuilder.DefaultVibrate = False
Dim plV() As Long = Array As Long(0, 0, 1)
foNotifyBuilder.CustomVibrate = plV
And that had no effect.

@DonManfred - Thanks for your testing, I am beginning to suspect the Strat is just broken and the customer may have to live with good vibrations ;)
 
Upvote 0

Kevin

Well-Known Member
Licensed User
Longtime User
I had problems with this as well and never could solve it. I don't know where the trouble lies but it definitely only affects certain devices.

My app has many calls to show or update the notification in various spots. What I did was saved the current state of the notification (i.e. the text it displays and any extra info) in variables and every time my app wants to update the notification it first compares the new text to display with the old text, and it only calls the function to update it if something has changed. If I hide the notification, I also toggled a boolean to keep track of that as well.

While this doesn't stop the vibration problem, it at least keeps it to a minimum by only actually setting the notification when absolutely necessary.

Some devices also seem to have options for extra vibrations when showing notifications (in the phone's settings) but I don't know whether it would make a difference or not. I haven't had reports of this lately but I suspect it is because the ones having the problem either uninstalled my app or got a different phone.
 
Upvote 0

HimeAnator

Member
Licensed User
Longtime User
@HimeAnator - Did you ever solve this problem? I'm testing on a Samsung Stratosphere (SCH-I405) and am having the same problem. Every time I display a notification I get a series of vibrations (1 long, 2 short, 1 long, 2 short), it doesn't matter what value I set "Vibrate" to, the basic code is:
B4X:
foRegularNotify.Initialize
foRegularNotify.AutoCancel = True
foRegularNotify.Icon = "icon"
foRegularNotify.Insistent = False
foRegularNotify.Light = False
foRegularNotify.Number = 2
foRegularNotify.OnGoingEvent = False
foRegularNotify.Sound = False
foRegularNotify.Vibrate = False
foRegularNotify.SetInfo("My Application Notification", "There are " & iNumNew & " new items to view.", Me)
foRegularNotify.Notify(1)
I have tried both the "built-in" notification object as well as Barx's library and they behave the same.

Interestingly, this is the same vibration pattern I get when I launch the B4A Bridge application on the Stratosphere as well. I have attached a sample program if anyone else can try to replicate this for me, or if they have any suggestions to suppress the vibrate.

Thanks in advance,
- Richard

I know I'm a little late to respond to you, I didn't see the reply you sent right away. But like the other posts seem to conclude, there is no true solution. I gave up on it after a while. I just hope not too many people have a Samsung Stratosphere or any of the other phones that cause this lol.
 
Upvote 0

chrjak

Active Member
Licensed User
Longtime User
Btw. it's on the s4 as well...
Maybe a bug of b4a? Because I know apps, which don't vibrate even in "Vibrate Profile"

Edit: And trying to remove the vibrate permission didn't help, too!
 
Last edited:
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
Btw. it's on the s4 as well...
Maybe a bug of b4a? Because I know apps, which don't vibrate even in "Vibrate Profile"

Edit: And trying to remove the vibrate permission didn't help, too!
Post your code relating to notification or a project showing the issue. Never had a problem on my s4
 
Upvote 0

chrjak

Active Member
Licensed User
Longtime User
its crazy....
i have now the problem that the program doesn't take icons any more.
n.icon = "icon" works
n.icon = "info" (exists in folder) shows notification but no icon
n.icon = "info.png" shows nothing. no notification, no icon

Whats the problem???
 
Upvote 0

James Chamblin

Active Member
Licensed User
Longtime User
I once tried an app (can't remember the name of it).it allowed you to override another app's vibrate and notification tone settings with your own. Maybe the stratosphere has such an app built in? In that case, the user would need to turn off the custom vibration from within that app to allow yours to function properly.
 
Upvote 0

chrjak

Active Member
Licensed User
Longtime User
Notification1.Initialize
Notification1.Icon = "info"
Notification1.Vibrate = False
Notification1.Light = False
Notification1.Insistent = False
Notification1.Sound = False
Notification1.SetInfo("Text" , Main)
Service.StartForeground(2, Notification1)
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Maybe you forget the
B4X:
Notification1.Notify(1)
?

You can export as zip and upload the project here. It will help us to help you when we can see the complete code you are using.

Please describe what we need to do to encounter the issue you have (and what issue you have)
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
also ..
B4X:
Notification1.SetInfo("Text" , Main)

should be ..
B4X:
Notification1.SetInfo("Title","Text" , Main)
 
Upvote 0
Status
Not open for further replies.
Top