Display of sizes of different icons on different devices

I'm trying to dynamically set a different icon based on the device. I've set up another point of entry in the xml of the application descriptor file. It passes an argument of "icon" in my application main().

The entry point is triggered as expected (installation of the application and to the power of the cycle), but he has problems when calling updateIcon() on some phones (for example BB 8900 T-Mobile version 4.6.1.231 (Platform 4.2.0.108)). Looks like it fails on phones with OS 4.7 and works very well on phones on or above this level.

The error I get is IllegalArgumentException: "Module with handle [XXXX] and [X] index has no application entry point. Try to set the index to both 0 and 1 on updateIcon() has the same problem.

It is only happening when I install the application OTA (works on the 8900 charging cable).

I have my code below from from the section of this topic:

public static void main(String[] args) { if ( args != null && args.length > 0 && args[0].equals("icon") ){      MyApp instance = new MyApp(true); } else {      MyApp instance = my MyApp(false); } instance.enterEventDispatcher();}

public MyApp(boolean autostart){   if(autostart){        Bitmap loadedIcon;        int width = HomeScreen.getPreferredIconWidth();       int height = HomeScreen.getPreferredIconHeight();

      //conditional logic to initialize "loadedIcon" based on device icon width

      final Bitmap icon = loadedIcon;       invokeLater(new Runnable(){                 public void run(){                    ApplicationManager myAppManager = ApplicationManager.getApplicationManager();                     boolean keepGoing = true;                     while (keepGoing){                        //Check if the BlackBerry has completed its startup process.                          if (myAppManager.inStartup()){                            //The BlackBerry is still starting up, sleep for 1 second.                            try {                                 Thread.sleep(1000);                           } catch (Exception ex) {                                //Couldn't sleep, handle exception.                             }                         } else {                              //The BlackBerry has finished its startup process.                            //Set the rollover icons.                             try {                                 HomeScreen.updateIcon(icon, 0);                               HomeScreen.setRolloverIcon(icon, 0);                              } catch(Exception e){                                   System.out.println("setting icon caught: " + e.getMessage());                                 e.printStackTrace();                            }                             keepGoing = false;                        }                     }                     //Exit the application.                   System.exit(0);               }             }); } else {      //load the app normally, with UI. }}

I use Eclipse plug-in 1.1.2 to build my app, but article is older, obsolete 1.0 plugin, maybe the instructions no longer apply and must be updated?

Understood the problem, basically it is a condition of race as described here which is also in addition to restarting the device. It happens when the application is installed OTA and the entry point to attempts to define the icon when the application is not fully registered with the device. In a Word, it is the valid response (in invokeLater):

int failedTries = 0; //failed attempt counter (maximum of 5 attempts for this example)public void run(){                     ApplicationManager myAppManager = ApplicationManager.getApplicationManager();                     boolean keepGoing = true;                     while (keepGoing){                        //Check if the BlackBerry has completed its startup process.                          if (myAppManager.inStartup()){                            //The BlackBerry is still starting up, sleep for 1 second.                            try {                                 Thread.sleep(1000);                           } catch (Exception ex) {                                //Couldn't sleep, handle exception.                             }                         } else {                              //The BlackBerry has finished its startup process.                            //Set the rollover icons.                             try {                                 HomeScreen.updateIcon(icon, 0);                               HomeScreen.setRolloverIcon(icon, 0);                                          keepGoing = false;                                          //Icon should of been set at this point                             } catch(Exception e){                                 System.out.println("setting icon caught: " + e.getMessage());                                 e.printStackTrace();                                          failedTries++;                                    try {                                     Thread.sleep(2500);                               } catch (Exception ex) {                                    //Couldn't sleep, handle exception.                                 }                                          //Since the attempt failed, we sleep for two and a half secs and try again.                              }                             if(failedTries > 4){                               //Worst case. Should revert to a default icon if it fails to be set after five tries.                                 keepGoing = false;                            }                         }                     }                     //Exit the application.                   System.exit(0);               }

Catch the exception, and then sleep for about two seconds and leave the loop to set the icon again, because it will succeed on the second or third try (at that time that the app must be registered with the device, including its entry point). In addition, to ensure a maximum test because you do not want to create a possibility of an infinite loop if for some reason, it fails to set the icon each time.

Tags: BlackBerry Developers

Similar Questions

  • What is the size of the icons asking the device to storm

    Hi all

    What is the size of the icons asking the device to storm?

    Thank you. I will try.

  • Website size is different in the different devices

    My Web site will appear in different sizes in different devices and adjusts, how to fix this?

    What you're looking for, it's what we call sensitive design.

    Unfortunately, Muse doesn't support sensitive design at the moment. However, if you have experience with web programming, Dreamweaver CS6 reactive load design with Media Queries and fluid grid Layouts, which publishes the CSS styling for each screen size.

    Take a look at this article!

    http://www.adobepress.com/articles/article.asp?p=1870087

    Hope this helps,

    Julia

  • How to make different display sizes in different libraries

    I have 6 libraries:

    • Documents
    • Videos
    • Photos
    • Music
    • Movies
    • TV shows

    I want that all my libraries for all large icons except for the Documents

    • Details for Documents
    • Large icons for the video
    • Large icons for the photos
    • Large icons for the music (see cover art)
    • Large icons for movies
    • and TV shows large icons

    But instead of that, to get the size of different point of view in the Documents, I get all libraries in large icons , which is annoying for me (because the Documents contains many Documents Word or TXT, which is very confusing for me to navigate files).

    Please help, this thing that annoys me a lot. Thank you

    Hello

    Unfortunately, such libraries of Documents, videos, photos, movies, music, etc... cannot have different views. They are universal.

    As an alternative, you can create shortcuts to the directories of libraries, or start > and select your username just below your icon and select the folder in this way.

    Kind regards

    Patrick

  • "" "" Sizes of different icons, depending on the Tools toolbar, they are in? ' "

    I would like to have large icons on my navigation toolbar, but small icons in all other toolbars.

    Checking / unchecking the exchange of "small icons" box the size of all icons. For example, when I check the box, the icons in my navigation toolbar become small, but I want them to be great.

    Can anyone help?

    TotalToolbar: http://totaltoolbar.mozdev.org/

  • Editor in the file blackberry - tablet.xml AND size of the icons

    The fact of the Editor:

    This line

    A name goes here

    Must be the same name as the company that has been registered under the account of the seller of blackberry appworld? Or if not a business then the same name as the person who has been registered under the account of the seller of blackberry appworld?

    Also, this is a completely different issue, but the size of the icon of the application should be 86 x 86 as a PNG, right?

    The tag in the file blackberry - tablet.xml is the same name you registered with your keys and are identical to the CN value during the signing process.

    86 x 86 PNG is fine.

  • How can I reduce the size of the icons on my monitor

    How can I reduce the size of the icons on my monitor

    Even under Vista or Windows 7. Right-click on the DESKTOP, SELECT DISPLAY, and then select the size you want. If largest size, so inferior next select the size down.

  • How to increase the size of the icons in the notification area (lower right corner of the XP taskbar)

    For some reason when I booted up my laptop, the icons were tiny and too small for my eyes. I think it was related to the installation of TestOut LabSim software on the laptop, because I noticed that the problem after doing so.

    I was not yet aware that it was possible to adjut the size fo the icons in the notification area. All the links I found affect the icons in the start menu, or quick launch menu, but not the notification area.
    The notification area is now two-lines, if it used only one, but the size of the taskbar has not changed. My DPI settings are always set to 'large '. The display resolution is unchanged.

    The thing where you right-click the taskbar, choose 'Properties', then click on "Start menu", then customize, then choosing "large icons" is only the start, not the notification area menu. It is also already on large icons.
    In addition, the thing where you right click on the Quick Launch bar and ends by choose "large icons" affects only the Quick Launch bar, not the right notification icons.

    http://www.Flickr.com/photos/10736018@N05/5876069573/sizes/l/in/photostream/

    How do I do the large icons again so I can actually see them? My eyes are not more perfect, and I would rather not be squinting when using my laptop. I think seriously increase the DPI to 150% in its current form.

    Hi bhermance,

    Method 1

    Try the steps mentioned below and see if it helps.

    one) to open display, click Start, click Control Panel, click appearance and themes, and then click display.

    (b) click on the appearance tab, then Advanced.

    (c) now select buttons of legend in the list of items and increase the size.

    (d) click OK and apply

    Check if that helps.

    Method 2

    If the previous step fails, then I suggest that you uninstall TestOut LabSim software of the computer and check if it helps.

    How to change or remove a program in Windows XP

    http://support.Microsoft.com/kb/307895

  • Size of the icons in the Quick Launch bar

    The icons in the Quick Launch bar are usually about half the size of the icons on the desktop. Mine are now the same size, which is awfully big for the Quick Launch bar. Having the taskbar at the bottom of my screen, it takes at least two lines to display the icons.

    What I found the same icons are used, but it seems that there must be a way to set the size of the icons shown.

    How can I resize them to their normal size? So far, I found nothing on this topic, any ideas here?

    TIA,

    Margriet

    First of all, it must unlock the taskbar, if it is locked. Now on the first line in front of the icons, right-click when the arrow on the side shows. At the sight of quality performances. Switch to the kid. If it is already on small, for some reason any. Put it in wide and apply, then back to small to see if it returns it. [_1337_Pete_]

  • How can I increase the size of the icons in my taskbar

    I use Win XP Pro... Recently had cleaned by Microsoft Techs!  HE HE I need my taskbar icons returned to their large sizes

    Hi Stevie,

    You can follow these steps below to increase or decrease the size of the icons in the taskbar and check:

    a. right click on the desktop and then click Properties.

    b. in the display properties dialog box, click the appearance tab.

    c. click on the Advanced button.

    d. in the Advanced Appearance dialog box then select the buttons of legend and change the size to reduce or increase the size of the icons on the taskbar or quick launch icons.

    You can also see the following articles for more information:

    Make Windows XP as you wish

    http://Windows.Microsoft.com/en-us/Windows-XP/help/Setup/personalize-Windows-XP

     

    How to change the appearance of items on the desktop in Windows XP

    http://support.Microsoft.com/kb/310543

     

    Hope the helps of information. For any other corresponding Windows help, do not hesitate to contact us and we will be happy to help you.

  • Is it possible to change the size of the icons?

    I have high resolution and you want to increase the size of the icons. All I can do is to set the size of icons on the desktop. But I need to set the size of the icons on the Panel, the icons of the folders and files (while I look at the list of detailed files, no icons).

    I already found out how to set the size of the icons of the system or the panels. It is also in advanced display option.

  • Change the size of the icons on deskyop

    I have a Compaq laptop running windows 7. All the icons on my desk suddenly went great. How can I reduce the size of the icons? I tried to use the display Control Panel instructions, but it did not work.

    Hello

    Right-click the desktop, point to view, and then click large icons, medium icons or classic icons. (Classic icons are the smallest size).

  • How to change the text size and the size of the icons

    original title: the size of the text and the size of the icons

    one of my friends was on the computer and somehow changed the size of my text and the size of my icons on my desktop, how do I do it please help

    Well, it depends on what he / she did it.  Right-click on the desktop and go in customize, then it could be the display settings have been reduced or appearance has changed.  So you have to play with the settings there to understand.

    Steve

  • Change the size of the icons

    How can I change the size of the icons on my g4 motorcycle more homescreen?

    It is not possible to change the size of the icons for Google now Launcher. However - you can install any third party such as Apex Launcher / Nova if it's a real eye sore for you :-)

  • How can I display the size of the façade?

    Hello

    I use the vi Analyzer do ensure that all front panels are the right size. Is there a way to display the size of the cover without having to run the VI Analyzer?

    You can open the VI, go to file > VI properties > Window Size > set to the size of the current screen, reading of the height and width, and then click Cancel.

    Or you could do something like the following if you want to programmatically and simply provide a path to the VI you want to check:

Maybe you are looking for

  • Attached to a mail - mdwrite quit unexpectedly

    I have real problems with attachments to mail 9.3 (Yosemite 10.11.6). Several things are going that they started before this last update to 10.11.6: -Glance does not work on attachments -I can't right click on any accessory to bring up the context me

  • No sound on Satellite phone? easily attaches.

    OK, read this and cry with laughter. After about six months of messing around with the drivers and all other software component I could think I sussed finally happening. You know that little thing twirly on the front, right next to the wifi switch? Y

  • -Battery Thinkpad 8 meter

    Hi guys,. I bought a Tablet thinkpad 8 and updated updated to windows 10 battery meter do not count correctly for example the battery brands 80%, but the remaining time is 20 minutes.I did the tests of the lenovo software and the result is battery ok

  • Log out of camera

    Hello I use the Vision Acquisition Express VI into a while loop. The vi itself begins with an event. Now, if I start the Vision Acquisition Express VI for the first time I can see the live image. After the slaughter of the while loop and restart the

  • I need the phone number for the activation of the system preinstall windows 7 64 in the USA

    I need the phone number for the activation of the system preinstall windows 7 64 in the USA