07-30-2008 05:19 PM
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!
Solved! Go to Solution.
07-31-2008 09:50 AM
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.getPr
eferredIconHeight(); int width = net.rim.blackberry.api.homescreen.HomeScreen.getPr eferredIconWidth();
Then set the appropriate icon using:
eIcon( icon );
07-31-2008 11:07 AM
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!
07-31-2008 11:31 AM
"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.
07-31-2008 11:43 AM - edited 07-31-2008 11:45 AM
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.
07-31-2008 03:46 PM
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.
08-01-2008 12:08 PM
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?
08-01-2008 02:43 PM
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