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
New Developer
patrick8341
Posts: 20
Registered: ‎07-18-2008
My Device: Not Specified

Change trackball color for 8100 device

This sounds really simple, but I cannot make it work. Here is my code snippet:

    if(LED.isPolychromatic(LED.LED_TYPE_TRACKBALL))
    {
        LED.setColorConfiguration(LED.LED_TYPE_TRACKBALL, 100, 100, 0x007F0000);
         try
         {
             Thread.sleep(1000 * 5);
         }catch(Exception e){}                      

          LED.setState(LED.LED_TYPE_TRACKBALL, LED.STATE_OFF);
    }

I built the applicatio with JDE 4.2.0.98 and tested with my 8100 Pearl device, the trackball does not light up, nor does it change color.
If I change the type to LED.LED_TYPE_STATUS, the LED status works properly. Any ideas?

Thanks.
Please use plain text.
Administrator (Retired)
mkirkup
Posts: 179
Registered: ‎07-14-2008
My Device: Not Specified

Re: Change trackball color for 8100 device

The ability to change the color of the trackball is actually based on hardware and software.  There is an LED that was placed under the trackball in the earliest versions of the Pearl but was subsequently removed since no one was really using it except the phone application on the device.  As such, it is likely that your device that doesn't support it in hardware.

 

Mike Kirkup
Director, Developer Relations
Please use plain text.
New Developer
patrick8341
Posts: 20
Registered: ‎07-18-2008
My Device: Not Specified

Re: Change trackball color for 8100 device

I am pretty sure that my hardware does support it, because I have installed a commercial application which can change the trackball color on my pearl device.

 

Is it because that I built the application with a newer version of JDE (4.2.0.98), while my simulator is running on top of OS 4.2.0.61, and my pearl device is running on OS 4.2.0.42?

On the 8100 simulator, the LED status lights up, not hte trackball.

On the 8100 device,neither the LED status nor the trackball lights up.

 

Anything wrong with the java code itself? 

Thanks.

 

 

 

 

Please use plain text.
BlackBerry Development Advisor (Retired)
bzubert
Posts: 86
Registered: ‎07-11-2008
My Device: Not Specified

Re: Change trackball color for 8100 device

A quick test worth running is LED.isPolychromatic(int type), passing in LED_TYPE_TRACKBALL.  Then, run a test using the defined blink red pattern in the javadoc for LED.setColorPattern(int type, int[] pattern, boolean repeat).  The original Pearl hardware running 4.2.0 should be capable of supporting this functionality. 
Brian Zubert
Technical Partnership Manager
Research In Motion
Please use plain text.
New Developer
patrick8341
Posts: 20
Registered: ‎07-18-2008
My Device: Not Specified

Re: Change trackball color for 8100 device

Brian,

 

I tried your suggested solution on my pearl device. Here is the code snippet:

 

boolean ispc = LED.isPolychromatic(LED.LED_TYPE_TRACKBALL); if(ispc) { int[] pattern = { 0x000000FF, 1500, 50, 0x00000000, 5850, 50 }; LED.setColorPattern(LED.LED_TYPE_TRACKBALL, pattern, true); }

 When testing the above code, the LED status lights up with blue color, but not the trackball, althrough I did use "LED_TYPE_TRACKBALL" type. My device is indeed capable change the trackball color, as I used such third-party program before.

 

It looks like I am still missing something in my code, am I? 

 

 

 

Please use plain text.
BlackBerry Development Advisor (Retired)
bzubert
Posts: 86
Registered: ‎07-11-2008
My Device: Not Specified

Re: Change trackball color for 8100 device

Note that this is untested and merely a hypothesis, but I'm wondering if maybe the cause is that the state for the Trackball could be off.  If you call LED.setState() first, does that help?
Brian Zubert
Technical Partnership Manager
Research In Motion
Please use plain text.