BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 06-07-2006, 02:32 PM   #1 (permalink)
New Member
 
Join Date: Jun 2006
Model: 7100
Carrier: multiple
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Application Desktop Icon Rollover.. Possible Solution?

Please Login to Remove!

Hi all...
I was wondering how to achieve cool rollover effect of application over the BB but there was no much information around... instead a found several post about imposibility (at least via JDE ... )
Well.. after a couple of hours I've managed to get a usable solution ... or so i think.. maybe there are some flawled tricky background crap involving such an use of BB api but.. i dont know and this seems to work fine..
Could someone of you realle experts on BB dev check it aput and tell??


The solution seems easy to implement...
First, attach this code on yout UIApplication derived class (the class that holds main() method )

Code:
public static void setRolloverIcon(){
        //PNG Image MUST be added to project befor compile.
        //on same folder
        net.rim.blackberry.api.homescreen.HomeScreen.setRolloverIcon(net.rim.device.api.system.Bitmap.getBitmapResource("mTacticsdemoL.png"));
    }
Second, alter yout main() method like that:

Code:
   public static void main(String[] args)  {
        if (args!=null && args[0].equals("icon")){
            setRolloverIcon();
            System.exit(0);
        }
        //lllalalaa rest of app starting upp proccess
        Login theApp = new Login();
        theApp.enterEventDispatcher();
    }
Third, add new procect to JDE WorkSpace, and call it whatever u want

Forth , go to this new project properties->Application
Set type to Alternate XXXX Application Entry Point (in my case, CLDC)
Set "Alternate entry point for:" value to main project
Set "icon" as value for "Arguments passed to static public void main...."
Check System module and Auto-Run on start-up checkboxes.

Et voila...

That all should be done...
Compiler creates an alternate entry-point for our app. This entry point calls main method with especific param that tells main to set rolloverIcon and exit inmediatly.
By launching this on startup, we ensure that our rollover is set when home desktop popups...
so... any ideas of impacto over system... ?
Any other way to get around this problem... ?

Thanks!

Cheers!
Offline  
Old 06-07-2006, 04:52 PM   #2 (permalink)
New Member
 
Join Date: Jun 2006
Model: 7100
Carrier: multiple
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

mi own answer... unfortunately, HomeScreen class is only available from v4.1 API version upward.... crap :D

cheers!
Offline  
Old 09-26-2006, 11:27 AM   #3 (permalink)
New Member
 
Join Date: Sep 2006
Model: 8700c
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

kelvar,

I wanted to create rollover icon either, and just got over the same method you described here. But the problem is that HomeScreen.setRolloverIcon() is a part of secure API available to signed applications only. Otherwise the method seems OK to me, but I don't feel like signing the app solely for having an icon.

Still surfing the web for any other method...
Offline  
Old 11-02-2006, 02:23 AM   #4 (permalink)
New Member
 
Join Date: Oct 2006
Model: 7290T
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default It's right

in Project properties setting, not check the System module check box and in the main() method, not call System.exit(0), i think it will effective.
Offline  
Old 11-02-2006, 09:35 AM   #5 (permalink)
Thumbs Must Hurt
 
Join Date: Jul 2006
Location: Atlanta
Model: 8703e
Carrier: Sprint
Posts: 58
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Add the following argument or you will get an arrayindexOutOfBoundsException when starting your application.

if (args!=null && args.length != 0 && args[0].equals("icon"))
Offline  
Old 01-12-2007, 02:10 PM   #6 (permalink)
New Member
 
Join Date: Dec 2006
Model: 8700
Posts: 13
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey everybody, I did everything as described above and the rollover icon works perfectly in simulator for 8700. But does not work on the actual device!!!
Upon startup, when the helper app autostarts to set rollover icon i get: "Alternate Entry point is not Defined for thread xxxx".
Any idea why is it ?

Thanks.
Offline  
Old 01-14-2007, 08:14 AM   #7 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2005
Model: 7290
Carrier: Cingular
Posts: 17
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had the same problem in an app I'm working on. I had to physically code the index into the setRolloverIcon method. I have two icons. s1.png and s2.png. s1.png is defined in my project settings.

public static void main(String[] args) {

if ( args != null && args.length > 0 && args[0].equals("gui") ) {
// start the gui
}
else {
try {
Bitmap icon = Bitmap.getBitmapResource("s2.png");
HomeScreen.setRolloverIcon(icon, 1);
}

catch( Exception e ) {
}

// enter the event dispatcher
}
}

The reason for the swallowed try/catch is that this is actually supposed to be executed when the blackberry fires up. Since you'll be deploying your app while blackberry is already running, there's a good chance this method will throw an exception.

Hope that helps,
-- Jason
Offline  
Old 01-14-2007, 09:20 AM   #8 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2006
Location: Peru
Model: 8310
PIN: 242F8970
Carrier: Claro
Posts: 15
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Wirelessly posted (Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) BlackBerry7100i/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/103)

I dont't know where to post this question. I want to know if there is a way to put links on the homescreen of some of the browser bookmarks I use more frquently.
Thanks.
Offline  
Old 01-15-2007, 05:06 AM   #9 (permalink)
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

completely wrong place to post this question. but the solution is: meshsystem >> webShortcuts for Blackberry xxx45; Free Application
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
Offline  
Old 01-15-2007, 10:38 AM   #10 (permalink)
New Member
 
Join Date: Dec 2006
Model: 8700
Posts: 13
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

To jsm174,
Hey, thanks for help. The try..catch took care of the app throwing error message upon BB startup. The rollover icon does not get set though.
So the funny thing is: i use the same line to set rollover icon when my app is actually launched, and it works fine. So it looks like the rollover image is not visible( registered ) in os until one actually launches the app. Hopefully i find fix soon
Offline  
Old 01-15-2007, 12:56 PM   #11 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2005
Model: 7290
Carrier: Cingular
Posts: 17
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

no problem. Maybe your app needs to fire up in the bg. Here are my settings. BTW, rollover is a signed API.


I have two projects.

app
app_gui

app
---

Project type:
CLDC Application

Ribbon position:
[x] none 0
[x] system module
[x] Auto-run on startup

icon:
s2.png

app_gui
--------
Project type:
Alternate CLDC Application Entry Point

Alternate entry point for:
app

Arguments passed to "Static"...:
gui

Ribbon position:
[ ] none 1 (Not checked)

Icon:
s1.png


-- Jason
Offline  
Old 05-15-2007, 01:44 AM   #12 (permalink)
Thumbs Must Hurt
 
Join Date: Mar 2007
Location: India
Model: 8100
Carrier: Airtel
Posts: 64
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question About to change application icon

Hello all,

I done whatever u told. But still my application displays only one icon in homescreen.

Can anybody tell me how to change application icon?

I have one icon that I display and applied through JDE. Now i want to change this icon when it gets focus on it. Can anybody help me?

Plz

Thanks
__________________
Crazy for BlackBerry
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.