views:

92

answers:

3

I'm trying to experiment with LED colors on my Nexus One and i'm having problems with creating any LED-light (color) with notification. LED-light isn't working. I have tested hardware malfunction and that isn't the problem. Here is the code.

    Notification notification = new Notification(R.drawable.icon, tickerText, System.currentTimeMillis());

    notification.ledARGB = Color.WHITE;
    notification.ledOnMS = 300;
    notification.ledOffMS = 1000;
    notification.flags = Notification.FLAG_SHOW_LIGHTS | Notification.FLAG_AUTO_CANCEL;
    //notification.defaults = Notification.DEFAULT_ALL;

    notification.setLatestEventInfo(this, getText(R.string.tekst1),
                   text, makeIntent(R.drawable.icon));

    notificationManager.notify(R.layout.main, notification);

Can somebody tell me what am I doing wrong? Tnx.

A: 

The problem is that notification light isn't shown until mobile phone goes dark (screen turns off). Everything else (includeing code) is OK.

Ante B.
A: 

Sepration again... I would try to set the Color like rgb(254, 254, 254). Maybe the 255 is an indicate for...something else. I actually tried a custom rgb on my G1 and the results were not what I've expected. There is a multi-colour LED, but you almost cannot see the differences between the base and the custom colours. I made something between magenta and blue and the result were a partly magenta, partly blue LED, not really mixed. Maybe its just not that visible on such a small LED. For example rgb(200, 235, 255) should be a very bright blue. It turned out like magenta...

Its a matter of trying out and, of course, trying it on several differnt phones! The base colours (Colour.RED, .GREEN ect...) seem like right all the time. But those custom ones are buggy or just not that good looking. At least on the G1.

So far, Kee

Keenora Fluffball
OS aproximates the color of LED. It can' show black, right?
Ante B.
A: 

I think for Nexus One you have to actually root the phone, then after installing some extra software (cyanogenmod has it by default) your trackball will actually show the color the developer is sending for the LED. Otherwise it will just always be white.

schwiz
:) no, that isn't true. you don't have to do it. you just have to turn off phone's screen to show LED light. code is 100% ok.
Ante B.