Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

LED under OS 4.5

I use this code to activate the green LED under OS 4.5 and OS 4.2:

 

LED.setState(LED.STATE_ON); LED.setColorConfiguration(LED.LED_TYPE_STATUS,2000,500,0x00009900);

Under OS 4.5 it switches on the green LED, but in a very dark green, not 100% of the strength. It also does not blink (2000ms activated, 500ms not activated).

 

But on OS 4.2 it is a very bight green and it blinks 2000ms on, 500ms off.

Is there a difference in OS 4.2 and OS 4.5 on how the LED is controlled?

 

 

 

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: LED under OS 4.5

The LED is controlled in the same way.

 

What BlackBerry models are you testing on?  Are you using the same device for both the 4.2 and 4.5 testing?  What is the full, 4 digit BlackBerry handheld software version you are testing with?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Re: LED under OS 4.5

If I use this code on those two device simulators:

8300 | OS 4.2.2.114

8300 | OS 4.5.0.44 

 

 

import net.rim.device.api.ui.*; import net.rim.device.api.ui.component.*; import net.rim.device.api.ui.container.*; import net.rim.device.api.system.*; import net.rim.device.api.util.*; public final class TestApp extends UiApplication{ private Screen _Screen; private MenuItem test1 = new MenuItem("test1",110,11000){ public void run() { LED.setState(LED.STATE_ON); LED.setColorConfiguration(LED.LED_TYPE_STATUS,90,70,0x00009900); } }; private MenuItem test2 = new MenuItem("test2",220,11000){ public void run() { LED.setState(LED.STATE_ON); LED.setColorConfiguration(LED.LED_TYPE_STATUS,90,70,0x00990099); } }; public static void main(String[] args){ new TestApp().enterEventDispatcher(); } private TestApp(){ _Screen = new Screen(); pushScreen(_Screen); } public final class Screen extends MainScreen{ public Screen() { super(); addMenuItem(test1); addMenuItem(test2); } } }

 

 

then it produces not the same result. Please test it yourself. On the 4.5 Simulator is it much darker and no fast blinking. On the 4.2 Simulator it works just as it should.

Thank you for looking into this.

 

 

 

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: LED under OS 4.5

Are you seeing different results on the BlackBerry Simulator versus a real device?  You state that you see the same results in the simulators listed, then say you see different results in the simulator.

 

Was one of those meant to refer to an actual BlackBerry?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Re: LED under OS 4.5

Sorry for being ambiguous. Yes, I see different results on the two simulators. When I try the application on a real device 8310 OS 4.5.0.37 then I get the same result as on the OS 4.5 of the simulator.
If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: LED under OS 4.5

I was able to reproduce this issue in version 4.5.  However, it has been fixed in version 4.6.  You can verify this using the beta release of the 4.6. BlackBerry JDE found here:  http://na.blackberry.com/eng/developers/devbeta.jsp#tab_tab_jde

 

As a work around you could create a loop or time that turns the LED on an off.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Re: LED under OS 4.5

Thank you Mark for looking into this.

So do you mean that no device running OS 4.5 can activate the LED blinking like this? Is it a "problem" of the API or the OS itself? 

 

Great, I tested it on the Bold Simulator running 4.6 and it works just fine!

 

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
Highlighted
Developer
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700

Re: LED under OS 4.5

Javec: Just FYI, but if you're wanting to light up green all the way you should provide a hex value of 0x0000FF00 instead of 0x00009900.  If you intended to use nines then just ignore this, I just wanted to make sure you know that hex values go up to F (15 decimal).