BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   Application Desktop Icon Rollover.. Possible Solution? (http://www.blackberryforums.com/developer-forum/37468-application-desktop-icon-rollover-possible-solution.html)

kelvar 06-07-2006 03:32 PM

Application Desktop Icon Rollover.. Possible Solution?
 
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!

kelvar 06-07-2006 05:52 PM

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

cheers!

seliv 09-26-2006 12:27 PM

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...

maggiecjw 11-02-2006 03:23 AM

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.

donricouga 11-02-2006 10:35 AM

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

if (args!=null && args.length != 0 && args[0].equals("icon"))

EZboy 01-12-2007 03:10 PM

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.

jsm174 01-14-2007 09:14 AM

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

jmajluf 01-14-2007 10:20 AM

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.

jfisher 01-15-2007 06:06 AM

completely wrong place to post this question. but the solution is: meshsystem >> webShortcuts for Blackberry xxx45; Free Application

EZboy 01-15-2007 11:38 AM

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

jsm174 01-15-2007 01:56 PM

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

renuka_anil 05-15-2007 02:44 AM

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


All times are GMT -5. The time now is 08:07 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.