Android :: How To Enable Vibration And Lights Using Notifications API?
Jul 21, 2010
I have created an application that creates notifications, using the following code:
// Notification notification = new Notification(R.drawable.notification_icon, title, System.currentTimeMillis());
notification.flags |= Notification.FLAG_AUTO_CANCEL;
// parameters
String ringtone = prefs.getString(context.getString(R.string.key_notifications_ringtone), "");
if (ringtone.length() > 0) { notification.sound = Uri.parse(ringtone);
notification.audioStreamType = AudioManager.STREAM_NOTIFICATION;
} boolean useVibrator = prefs.getBoolean(context.getString(R.string.key_notifications_use_vibrator), false);
if (useVibrator) { notification.defaults |= Notification.DEFAULT_VIBRATE;
} boolean useLed = prefs.getBoolean(context.getString(R.string.key_notifications_use_led), false);
if (useLed) { notification.defaults |= Notification.DEFAULT_LIGHTS;
notification.flags |= Notification.FLAG_SHOW_LIGHTS;
} // alert
RemoteViews contentView = new RemoteViews(context.getPackageName(), R.layout.notification);
contentView.setImageViewResource(R.id.notification_icon, R.drawable.icon);
contentView.setTextViewText(R.id.notification_title, title);
contentView.setTextViewText(R.id.notification_text, text);
notification.contentView = contentView;
Intent notificationIntent = new Intent(context, MyActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
notification.contentIntent = contentIntent; notificationManager.notify(1, notification);
The notification works, and the correct ringtone is used. However, even though the preferences are correctly activated and notification flags are correctly set (I checked by debugging), the notification never vibrates and never cause the lights to be activated. I would have blamed my phone's settings, but every other app using notifications, like messaging, gmail, and others correctly use all these features. (My phone is a HTC Hero with Android 2.1)
View 1 Replies
Nov 12, 2009
Is there a way to alter the intensity of vibration or the type of vibration for different notifications? Same goes for the LED light
View 5 Replies
View Related
Aug 3, 2010
Is their anywhere on the X that you can setup your LED lights for your notifications?
View 14 Replies
View Related
Jun 29, 2010
I saw this question asked before with no answer (a post in April) so I thought I would ask again. Does anyone know of an app that will allow vibration for e-mail notifications when phone is set to vibrate? This has always bothered me about a device that I otherwise think is just an outstanding piece of equipment. If anyone has an idea I would GREATLY appreciate it.
View 2 Replies
View Related
Dec 6, 2009
I have a Sprint HTC Hero w/ 1.5 (Nov 18 update). Can someone please share how to disable phone vibration when we dial a number? Also, I am using Handscent SMS, can you please also share how to enable phone vibration when writing a text message?
View 1 Replies
View Related
Jan 4, 2010
One little thing I miss on my Blackberry was that I had it set to vibrate once for Social Network notifications, twice for an email and three times for an SMS. That way I knew how important it might be and whether to take it out of my pocket. My T-Mobile G2/HTC Hero (1.5) doesn't seem to have the option to change the default "vibrate twice". Is there any way of changing it? Or an app that might do it?
View 1 Replies
View Related
Aug 3, 2010
Is there a way to not have it vibrate with notification sound on incoming texts and have it vibrate when I turn phone to vibrate mode. I cant seem to figure this out, I want it to vibrate when I have vibrate mode on but I want sound only when I have it off of vibrate mode. I know you can go into settings each time but I want to avoid that.
View 1 Replies
View Related
May 17, 2010
Every time I receive a notification, the phone also vibrates which I really don't like. Perhaps I am just missing something but I do not see a way to turn vibration off for notifications. Is it possible?
View 1 Replies
View Related
Nov 8, 2009
Is there a way to make all notifications vibrate instead of sound a ringtone?
View 1 Replies
View Related
Jan 17, 2012
I rooted my Sidekick 4G yesterday and everything worked great, until I noticed that my phone wasn't vibrating for notification. I tried messing around with the settings but no luck. I get haptic feedback but no notification vibrations.
Additional information:
Rooted with SuperOneClick (latest version, I'm pretty sure).
FROYO
2.2.1
View 1 Replies
View Related
Dec 2, 2009
Can anyone recommend an app that will extend the vibration time when a call comes in and for notifications. I find the vibration strong enough (coming from a BB 8900, the Hero is twice as strong) but the vibration time is a little short for liking.
View 3 Replies
View Related
May 8, 2010
Which folder do they go in (I can't find a "notifications" folder)
View 6 Replies
View Related
May 5, 2010
I have both my hotmail and gmail accounts set up but don't seem to get notifications of new emails. I only receive them upon going into the app itself. How do I get it so that I get a number icon or whatever over the app to show I have received emails?
View 3 Replies
View Related
Nov 29, 2013
My iPhone would tell me if I have a new SMS, Facebook notification, or message + a # indicator on the icon. anything similar for Android?
Right now I get a notification and it is available at the top if I slide down from home screen (hangouts, sms or mail) but is there anything that would enable similar to the below iPhone screen shot?
View 2 Replies
View Related
Jan 30, 2014
I have installed Desktop Notifications and Pushbullet. Both apps require me to enable them in the Notification Mirroring Service. To do that it always takes me wifi to switch the wifi on.I don't have wifi, I have 3G. How do I enable the service without wifi?
View 3 Replies
View Related
Jul 29, 2010
How do I enable notifications for updates to apps I've downloaded from the marketplace? Can't seem to find the option.
View 8 Replies
View Related
Apr 24, 2010
Is there a simple way to enable / disable vibrate for the phone / notifications? I tried using the volume rocker, going to vibrate there. That works for the ringers, but not notifications. I mainly want to set / unset vibrate for gmail and Google Voice. I have tried various 3rd party apps like Volume Control / Audio Manager, but nothing seems to work consistently.
View 2 Replies
View Related
May 14, 2010
I purchased the HTC Incredible and got it last week. In the last couple of days, I noticed the buttons at the bottom of the phone were sometimes lit and sometimes not. I went into the Verizon store today to pre-order the TV out cable and asked the tech about the lights. He said HTC was aware of several bugs and there will be an update shortly that will remedy them. On the TV out cables, they're all sold out. They're selling like hotcakes - same as the Incredible.
View 1 Replies
View Related
Apr 16, 2010
Saw a commercial for the i phone and one of the apps the woman turns off the lights/fans in her house by using an app. Is there anything like that in the Android market?
View 7 Replies
View Related
Dec 25, 2008
Looking for an App to make one of the lights blink so I can find my phone in the dark.
View 1 Replies
View Related
Jul 28, 2010
I use my android phone for a week now. Last night I noticed that the screens lights up for a few seconds. Is it because it wants to announce new mails or a callander item (without reminder!) ?
The flashing wakes me and uses battery. Can I turn it off?
I use Timeriffic and can turn down the brightness to 0% but I do not know if I want that. What if someone calls me and the brightness is 0%?
View 1 Replies
View Related
Jun 21, 2010
My only complaint about the Droid is the seeming lack of options for notifications.
Is there a way, or an app, that would allow you to assign different notifications to emails vs texts vs missed calls?
Also, does anyone know if there's a way to set the phone to re-notify you periodically if you have a notification that has not been looked at? I tend to leave my phone sitting on my desk at work and would like it to let me know if I missed a call or text while I was away from my desk.
Ideally I'd like to silence email notifications, but have text and missed call notifications with unique ring tones for each, and I'd like the phone to renotify me every 10 minutes or so if I have a text or missed call waiting for me.
View 3 Replies
View Related
Apr 25, 2010
In my android application I have the following As far as I am aware, I have followed the steps in the documentation to set it to play a sound from the resources folder, and to flash the lights. However, neither of these happen. It does, however, vibrate, as instructed. Any ideas what I'm doing wrong here? I've looked through the permissions that I can give the app in the AndroidManifest.xml file, but I can't see one for letting it flash the light or make sounds. Code...
View 1 Replies
View Related
Apr 30, 2010
On the front to the left the ear piece(just a little down) right to the left of the verizon logo, there are what looks to be (2) lights.. Once possibly blue and the other not sure.
View 4 Replies
View Related
Jun 9, 2010
What the heck have I done wrong? I've had this DInc for 24 hours now and darned if lights for the Home, Menu, Return and search buttons come on and off operatically. I've rebooted the phone a couple times but to no avail. Has anybody else had similar problems or am I just one of the lucky ones?
View 6 Replies
View Related
Sep 17, 2010
Is there an app that can make the led change colors for the captivate
View 2 Replies
View Related
Sep 26, 2009
I have this really crappy eye disorder I inherited genetically. It means my ability to see low light when other light is on is really poor. It's called Retinues Pigmentation. When the screen of my HTC Hero is on, I can't see the physical buttons at the bottom at all, they just come across too dark to me in contrast to the light screen. What would be really be ideal is for the buttons to stay on as long as the screen is on. Basically, if the screen is lit, so are the buttons. I know this would deplete energy, but it would be totally worth it for me. Do you think there is any way I could implement this, and is there someone I could mention it to for the future?
View 2 Replies
View Related
Oct 14, 2009
I wanted to use my HTC for an alarm clock because then i could save the electricity that my old alarm clock uses. Sometimes i wake up and have a look at my alarm clock but now i have to reach over and get the phone and press a button to get it to light up...very bright in the middle of the night. SO....What i was thinking. If i buy a charger stand for my hero is it somehow possible to tell the phone to run the screen lights on lowest light setting when it is charging... This way i would be able to se the clock without being blinded. IF this is not an option would someone please pass this on to goggle/htc as a request or tell me how i do it.
View 6 Replies
View Related
Jul 8, 2010
I noticed when I get a message, the notification light will only last a little while before it stops blinking. Is there a setting to keep the notification light going until the notification has been checked?I don't like having to power it up to know if I have a message, email, or missed call. I just like glancing at it to see if the light is blinking.
View 3 Replies
View Related
Nov 5, 2010
i have 2 small what should be LED lights near the ear piece however they have never lit up shouldn't they?
View 14 Replies
View Related