Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

blackberry star icon

i am developping an application that has chat&message support. I need to know weather it is applicaple on BB OS 4.5 to set a star icon on application icon as in messages application .

enter image description here

like image 896
Ahmet Gulden Avatar asked Jan 30 '12 15:01

Ahmet Gulden


1 Answers

You can do that. You need to have four images for the icons. They are

  1. Standard app icon
  2. Standard roll over icon
  3. Standard icon with a *
  4. Standard roll over icon with a *

Once you have that use the following code

                if (unReadChatMessages> 0)
                {
                    appIcon = Bitmap.getBitmapResource("app_alert.png");
                    rolloverIcon = Bitmap.getBitmapResource("app_rollover_alert.png"); 
                    // turn on the LED                   
                    if(LED.isSupported(LED.LED_TYPE_STATUS))
                    {
                        LED.setState(LED.STATE_BLINKING);
                        LED.setConfiguration(100, 1000, LED.BRIGHTNESS_100); 
                    }
                }
                else
                {
                    // use default icons... 
                   appIcon = Bitmap.getBitmapResource("app.png");
                    rolloverIcon = Bitmap.getBitmapResource("app_rollover.png");

                    // Turn off LED...                   
                    if(LED.isSupported(LED.LED_TYPE_STATUS))
                    {
                        LED.setState(LED.STATE_OFF);
                    }
                } 

                // Try to set the icons
                HomeScreen.updateIcon(appIcon, 0);
                HomeScreen.setRolloverIcon(rolloverIcon, 0);
like image 142
rfsk2010 Avatar answered Oct 14 '22 15:10

rfsk2010