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
GeekyDad
Posts: 56
Registered: ‎07-15-2008
My Device: Not Specified
Accepted Solution

Application Icon Size... Home screen won't use the right one. Help!

I thought I could include the various icons sizes (ie. 48x48, 32x32, etc..) and the device would choose the right application icon size depending on the device or theme. Obviously, this is not the case. So, how do you get the device to use the right sized icon for the theme?

 

For example, I have a Verizon 8330 (Curve) and the Verizon theme uses 48x48 sized icons. If I use a 48x48 sized icon for my app, it looks great. However, if I change the theme to any of the standard BB Dimension themes, it will scale-down my 48x48 icon to 32x32 which looks quite bad. Why does it not choose the 32x32 sized icon that I include? How can I provide both sizes and have it use the right size depending on the theme? It looks even worse when I use 32x32 and it then stretches it to 48x48. Help!

Please use plain text.
Developer
kzettel
Posts: 120
Registered: ‎07-16-2008
My Device: 9000

Re: Application Icon Size... Home screen won't use the right one. Help!

You'll have to do it programatically it your application startup.  You can use the following code to get the icon height and width:

 

int height = net.rim.blackberry.api.homescreen.HomeScreen.getPreferredIconHeight(); int width = net.rim.blackberry.api.homescreen.HomeScreen.getPreferredIconWidth();

Then set the appropriate icon using:

 

net.rim.blackberry.api.homescreen.HomeScreen.updateIcon( icon );

 

 

 

 

Kurt Zettel | Chief Architect | Metova
www.metova.com
Please use plain text.
Developer
GeekyDad
Posts: 56
Registered: ‎07-15-2008
My Device: Not Specified

Re: Application Icon Size... Home screen won't use the right one. Help!

Thanks so much for your response, kzettel. I did see references to code like that, but I just thought surely there was a better way since doing it programatically can't happen until my app is actually launched after installing, or after the theme has been changed. It's not ideal, but it's certainly acceptable and probably the only option for now.

 

Thanks again for the help!

Please use plain text.
Developer
richard_puckett
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700

Re: Application Icon Size... Home screen won't use the right one. Help!

"since doing it programatically can't happen until my app is actually launched after installing"

 

You can use the alternate entry point method to accomplish this before your app is actually invoked (same method used to set a rollover icon).

 

I'm not sure off-hand if we get notified when the theme changes.  If there's a callback or a global event that gets sent then you could listen for that and then update your icon accordingly.

Please use plain text.
Developer
jiggak
Posts: 28
Registered: ‎07-24-2008
My Device: Not Specified

Re: Application Icon Size... Home screen won't use the right one. Help!

[ Edited ]

You can define an alternate entry point for your application that handles setting up the home screen icon(s).  The trick is using an alternate entry point that runs on startup and simply exits once it's finished updating the icon.

 

See this knowlege base article

 

Edit: Opps, duplicate post... sorry Richard.

Message Edited by jiggak on 07-31-2008 11:45 AM
Please use plain text.
Developer
GeekyDad
Posts: 56
Registered: ‎07-15-2008
My Device: Not Specified

Re: Application Icon Size... Home screen won't use the right one. Help!

Thanks, Richard and jiggak, for the idea of using an alternate entry point for that. It will at least cover initial installation and device reboots. I'll give it a try. Let me know if you ever come across a way to handle a theme change. I haven't found a callback on that yet.

Please use plain text.
Developer
GeekyDad
Posts: 56
Registered: ‎07-15-2008
My Device: Not Specified

Re: Application Icon Size... Home screen won't use the right one. Help!

Darn! I was starting to implement my alternate entry point, and I just remembered why I moved away from it to begin with. In order to have an alternate entry point, but only have one icon for your app, you have to make the main app a System Module to hide it from the ribbon so you don't have two icons on the home screen. The killer for me is when you make it a System Module, it then requires a reboot when the app is installed or updated. One of those reboots that take forever to come back up!

 

Is there any way to have an alternate  entry point without having to make the main app a System Module to avoid the duplicate icons?

Please use plain text.
Administrator
MSohm
Posts: 14,421
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Application Icon Size... Home screen won't use the right one. Help!

Making an application a system module prevents the icon from being displayed on the home screen.  You can create an alternate entry point that is not a system module but it means that you would have 2 icons.  The following lists reasons why a reset may be required.

 

What Is - The reason a reset is required when upgrading an application
Article Number: DB-00602

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800620/What_Is...

 

 

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
Please use plain text.