The image appears only in running my application on device

Hello

use listfield where images are drawn.

the images are downloaded from a url using Analyzer, these images are

populated my listfield.

It works fine when running my apps on my Simulator

But doesn't work in the unit.

WATS the problem?

class Download extends Thread {
        private Vector urls;

        public Download(Vector urls) {
            this.urls = urls;

        }

        public void run() {
            try {
                System.out.println("starting downloading");
                for (int i = 0; i < urls.size(); i++) {

                    System.out.println("a part ofconstant url which is common " +i
                            + urls.elementAt(i));

                    imageData = getImage((String) urls.elementAt(i));

                    EncodedImage img = EncodedImage.createEncodedImage(
                            imageData, 0, imageData.length);
                    imageListElements.addElement(img);
                    System.out.println("image added");
                }
                System.out.println("\t\t Download completed");

                UiApplication.getUiApplication().invokeLater(new Runnable() {
                    public void run() {
                        System.out.println("Pushing the list screen");
                        AscreenListFieldCallBack callBack = new AscreenListFieldCallBack (imageListElements);
                        _list.setCallback(callBack);
                        System.out.println("imageListElements.size() --> " + imageListElements.size());
                        for (int i = 0; i < imageListElements.size(); i++) {
                            _list.insert(i);
                            callBack.insert("imageListElements", i);
                        }
                        add(_list);
                        invalidate();
                    }
                });

            } catch (Exception e) {
                System.err.println("Msg: " + e.toString());
            }
        }

        public void startThread() {
            new Thread(this).start();
        }

        public byte[] getImage(String url) throws IOException {
            HttpConnection connection = (HttpConnection) Connector.open(url + ";deviceside=true");
            DataInputStream iStrm = connection.openDataInputStream();
            ByteArrayOutputStream bStrm = null;
            byte imageData[];
            int length = (int) connection.getLength();
            System.out.println("length --> " + length);
            if (length != -1) {
                imageData = new byte[length];
                iStrm.readFully(imageData);
            } else {
                bStrm = new ByteArrayOutputStream();
                int ch;
                while ((ch = iStrm.read()) != -1)
                    bStrm.write(ch);
                imageData = bStrm.toByteArray();
                bStrm.close();
            }
            System.out.println("\n\n\n\n image Data  " + imageData);
            return imageData;
        }
    }

}

Once you start a download must be completed or throws an Exception.  I've never seen a communication process so nothing else.

But you say:

"in the console, it displays as started, but it is not downloaded.

I suspect that your treatment is throw an exception.  Have you checked this while debugging?

To answer your question later, yes there are limits of size of the files that can be downloaded.  The limit depends on the circumstances, but can be as low as 128 KB.  Of course, a picture of 128 KB is big enough, probably too large to display in a ListField.

I think it should be clear that it is much more effective to send a picture about the right size for the BlackBerry.  That way you'll spend less time of transmission and, if you want to scale on the BlackBerry, the scale is much faster.

Tags: BlackBerry Developers

Similar Questions

  • The images appear tense when played using the slide show in full screen

    The images appear tense when played using the slide show in full screen in Windows Vista Basic. That means that a picture of resolution 1920 x 1200 appears full screen covering although a 1920 x 1080 image seems letterbox in fullscreen. My screen resolution was put to the native resolution of 1920 x 1080. It is clear that this slide show program only keeping the proportions of the image. Earlier this problem wasn't there. I think that the slide show program addresses in such a way that my monitor could have 16:10 display of report resolution l / h. thanks for giving me a solution.

    This happens usually when the image resolution is high.

    Keep your screen resolution of 1024 x 768 and it should work fine.

  • When I start with Windows XP Home Edition, the screen appears, only the mouse arrow. Help!

    When I start with Windows XP Home Edition, the screen appears, only the mouse arrow.  Help!

    Hi stevejager,

    ·         Remember to make changes?

    ·         You receive an error when starting?

    ·         Have you tried booting in safe mode?

    Method 1: First of all, we will try to start the computer in last good known Configuration and see if it boots.

    Method 2: If it is impossible to start, try to start in safe mode. If able to start and then try to perform a System Restore, since this is a recent problem that has occurred.

    Method 3: Follow the steps in the below article mentioned.

    Computer stops responding with a black screen when you start Windows XP

  • When I turn on my laptop, a different user name and the image appears

    When I turn on my laptop, a different user name and photo will appear if I then select "change user", my own newspaper on the account and the image appears beside, which I can then access my PC. However, the account of the 'foreign' does not appear in the UAC - so I can't remove it from there. Any ideas please?

    Hello dhhuang,

    Sorry, seem to take your time on this.

    allI see in USERSare two folders;

    (1) Paul

    (2) public

    "" II I click on ' Paul ' and then capital letters to users in there I still don't see anything that resembles that.

    PS NTdata - what do Ido?

    Concerning

    Silverfox

  • Some time ago I bought Photoshop Elements in the apple App Store. I worked well. Now, if I try to start the application I get the message "Please do not run this application within this application package. On the other hand, it please launch Adobe Photos

    Some time ago I bought Photoshop Elements in the apple App Store. I worked well. Now, if I try to start the application I get the message "Please do not run this application within this application package. "Instead, please run Adobe Photoshop elements 13 of your Application folder. I tried this but it does not work. What to do to run the program?

    Follow these steps, Editor does not start | Mac App Store version

  • I did my own art of header for the toolbar and the dimensions and size of the file are correct, but the image appears badly in the area. Why?

    I used photoshop to make my theme header with 3000 pixels wide and 200 from the top. In addition, the file is less than 300 KB. But after that I downloaded it, the picture in these dimensions is amplified. I do not get the image I had intended. Why is this? See picture attached example.

    The support module is here: https://discourse.mozilla-community.org/c/add-ons

    Looks like this monitor is like 1750 pixels wide, give or take.

    The width of the whole image will not be displayed unless you have a display of 3000 pixels wide, and it is " pinned with the upper right of the image. Only, as a large part of the width will be shown that there is the width to display the image.

  • I have problem in the PDF export to save only the layers appeared only. When I export the indesign file to PDF that contains layers hidden pdf placed, pop up problem when I use the search field in exported pdf file. hidden text of hits from search results

    I have problem in the PDF export to save only the layers appeared only. When I export the indesign file to PDF that contains layers hidden pdf placed, pop up problem when I use the search field in exported pdf file. hidden text of hits from search results to laye

    I answered your question: there is nothing you can do in InDesign. You need to ask in the Acrobat forum I linked.

  • How to restore items where my images are returned in the top left corner when it is open, and they have a "mesh" around them? Something to reset elements so that the image appears in the center of the box... I can't have more than 1 in. image

    How to restore items where my images are returned in the top left corner when it is open, and they have a "mesh" around them? Something to reset elements so that the image appears in the center of the box... I can't have more than 1 image open at the same time to work on. I e I can't pass a layer on the image to the other.

    OK - I got out my trusty Photoshop Elements 10 - The Missing Manual and figured it out. What I was trying to describe, it was how to make images with 'tab' images 'floating '? This has somehow reset without my knowledge. What you need to do to get your images 'Floating' back is to click on "EDIT" in your editor - at the bottom of the drop-down list hover your cursor to "GÉNÉRAL" and click on - at the bottom of the drop-down list, click in the bottom left box 'ALLOW FLOATING DOCUMENTS IN FULL EDIT MODE' - and then click OK.

    That solved my problem!

  • How to load something when the image appears

    Hello. I have a load_swf button that does this:

    swf_path = "sample.swf"

    load_swf.onRelease = function() {}

    loadListener.onLoadProgress = {function(target_mc:MovieClip,_bytesLoaded:Number,_bytesTotal:Number):Void}

    info.text = Math.round ((bytesLoaded/bytesTotal) * 100) + "%";

    };

    loadListener.onLoadInit = {function(target_mc:MovieClip):Void}

    info.text = "";

    };

    var mcLoader:MovieClipLoader = new MovieClipLoader();

    mcLoader.addListener (loadListener);

    mcLoader.loadClip (swf_path, swf_loader);

    };

    I want to do without having to press the button. I want to do when the image appears on the screen. Something like OnClipEvent (load) the problem is that I do not know how to convert this code works with OnClipEvent (load), can you help me?

    use:

    swf_path = "sample.swf"

    loadListener.onLoadProgress = {function(target_mc:MovieClip,_bytesLoaded:Number,_bytesTotal:Number):Void}

    info. Text = Math.round ((bytesLoaded/bytesTotal) * 100) + "%";

    };

    loadListener.onLoadInit = {function(target_mc:MovieClip):Void}

    info. Text = "";

    };

    var mcLoader:MovieClipLoader = new MovieClipLoader();

    mcLoader.addListener (loadListener);

    mcLoader.loadClip (swf_path, swf_loader);

  • CS5: Image appears only in the magnification of 25% and 100%

    PS CS5 running successfully for a few years, then all of a sudden I can't work other than 25% magnification and the actual Pixels. The image disappears and I can only see the checkerboard. There is a "Windows update" I ran on 10 April, which included an update for the graphics card, which I think could be the culprit, so I uninstalled. It does not solve the problem, so I've updated again. I couldn't see anything else in these updates that should affect Photoshop.

    Here's what I've tried so far:

    I've updated my graphics driver (NVidia GeForce),

    Trashed Adobe Photoshop CS5 Prefs.psp (who crashed PS completely when I have opened it... Fortunately I kept the old file prefs on my desk and dragged in),

    Made sure Photoshop was up-to-date.

    Any ideas what to try next?

    Thank you!

    Photoshop CS5 (32-bit v.12.0.4)

    Windows 7 Home Premium (Build 7601 v.6.1: Service Pack 1)

    AMD Phenom II X 4 840 3.20 GHz processor

    This is a bug in the driver of your video card.

    Disable GPU drawing in Photoshop, or contact NVidia and understand what's wrong with the driver.

  • Images in the gallery appears only in the mapping

    Hello

    I created a Settings.isf file to import the FM 11 in RH10. During this process, I created a paragraph style (example of style), with a picture of model linked to a custom icon, I placed in the folder of symbols of the default folder Gallery (see image below).

    ExampleIcon_in Gallery.jpg

    After saving my settings file, when I try to import and map the relevant paragraph of the FM to this style, I don't see the icon. All other formatting I had defined are kept, except this icon.

    I place the images in the wrong place? Or do I have to change the path? Where I'm going wrong?

    Please guide.

    Anthony

    I think that Jeff is correct... you need to change your CSS in HR to get there.

    In most cases, you could modify the HTML code to conform to your current CSS, but since you link FM files, you will need to examine the HTML code generated by the binding files and edit the CSS to conform to the HTML code.

    If you change your mappings to the HR process, examine the generated HTML code and edit the CSS according to the needs.

  • (Impossible to write in the InDesign Server forum) - [Java/Corba] images appear only as gray box

    Hello, sorry to post here, but I can't post in the Forum ID. click on "post message" deletes the text...  We are working on our first plugin for InDesign Server. We create Documents with boxes and placing graphics (in PDF format) in this field. The problem is: after you open the document in InDesign, we see just boxes grey and without pictures. The links in the document are ok and when we print, we see the images. In my opinion, the internal preview of graphics are not created. Printing uses the original file, and there we can see the image.  In the code, we create a rectangle with addRectangle() and place the image with the command place(). Is there anything else that we have to see the image in InDesign?  Thanks for all the ideas Klaus Friese

    Hi Klaus,

    Take a look at the following to be called at startup:

    InterfacePtr iServerSettings (iSession, UseDefaultIID());
    If (iServerSettings)
    iServerSettings-> SetImagePreview (true);

    Best,

    Peter

  • Part of the image appears in the scanned image

    I have an officejet 6600 all-in-one printer.  Lately, whenever I try to scan the image is cut off.  Only a small part of the document appears in the final image.  The content is visible on the scanned image is in the lower right of the scanning space.  Please tell us what the steps should I take to solve this problem.  Thank you

    Hello Pierre,

    Welcome to the Forums of HP Support!

    I see you are trying to scan documents using your HP Officejet 6600, how ever you getting only a very small part of the analysis. What happens when you try to make a copy, the entire page produce on the copy?

    If the HP software, make sure that the scan size is set to sweep the area.

  • How to get the image appears?

    Hi have a problem to report a MXML component an arry in my main MXML application

    I don't understand why I get this error when it refers to a table in my main application.

    What I did: I've created a table in my main application where I am referring to a couple of images

    < mx:Array id = "picArray" >
    < mx:Object
    thumbnailImage = "assets/DSC_1904_thumb.jpg"
    fullImage = "assets/DSC_1904.JPG" / >
    < / mx:Array >

    later in the code I'm filling in the field of the icon of a horizontal list with the 'thumbnailImage' specified in the 'picArray.

    < mx:HorizontalList id = "picList".
    iconField = 'thumbnailImage '.
    Click = "showImage (Event)" "
    dataProvider = "{picArray}.
    itemRenderer = "CustomItemRenderer."
    columnCount = "4".
    columnWidth = "210".
    number of lines = "1".
    rowHeight = "120".
    horizontalScrollPolicy = 'on' width = '863' / >

    The photos appear in the list, and when I click on a PopUp is created to see the enlarged image. However, the PopUp does not show the "fullImage". It is at this time there no error message when I want to talk about the MXML of the TitleWindow component the "picList" in the main application in this way:

    < mx:Image id = source="@picList.selectedItem.fullImage"/ "popImage" >

    How can I get my picture to show?

    Dear Thomas

    Hello

    You need to make 2 changes to get this working:

    #1: ViewWindow.mxml


    showCloseButton http://www.adobe.com/2006/MXML"creationComplete =" init () ' = 'true' "
    Close = "PopUpManager.removePopUp (this)" width = "640" height = "480" title = "Impressions of the North Station" > "
       
            Import mx.managers.PopUpManager;
               
    [Bindable]
    public var imgPath:String;
               
    private function init (): void
    {
    PopUpManager.centerPopUp (this);
    }
    ]]>
       

       
           
       

    #2: Main.mxml

    public void showImage(e:MouseEvent):void
    {
    var viewWindow:ViewWindow is PopUpManager.createPopUp (this, ViewWindow, false) as ViewWindow.;
    If (viewWindow)
    {
    viewWindow.imgPath = picList.selectedItem.fullImage;
    }
    }

    I hope this helps.

    Kind regards

    Adrian Wiecek

  • the images appear psychedelic on Netflix

    Can't watch movies on Netflix because it looks like psychedelic.  I've updated the graphics driver, adjust the screen resolution for the optimum setting for this netbook and adjusted the color settings.  In my non technical level of expertise, I'm done.   I like to watch movies, can't.

    Hi JRabunwohl

     

    1. the problem occurs only with Netflix?
    2 have you tried other videos online using a different application streaming?

    If the problem is specific to Netflix so you can contact Netflix support for assistance and check. Refer to the below links for support.
    http://www.Netflix.com/contactus

    http://www.Netflix.com/help

     

    I hope this helps.

Maybe you are looking for

  • Pavilion g7: stranger in my local network

    I have 2 PCs in my local network. The old one works in windows XP SP1, the new one under the home premium windows 7 (64-bit). Both are set in my local working group. At first, I could see each one of the other and use files and printer. Then, after w

  • Qosmio G35-av600: how to use the display internal as a monitor using composite-in?

    I want to connect my video gaming system and use my laptop screen, but I can't seem to understand how to change the settings so that my monitor displays the video game? Composite in the settings? I have a G35-av600 bought last June. If anyone has any

  • Install second office jet 6310xi

    I bought a second 6310xi office jet. I have the software for the first printer on my computer now.  Is there a way I can use the 6310 software I don't not to print on the computer of nuw?   How do we install the second printer? I have a Windows XP Pr

  • No sweeping

    I have the range of printers HP psc 2175xi all-in-one.  I bought a HP Envy laptop pc with operating system Windows 8.1. The printer is connected via a USB cord. But the printer do not "talk" to the laptop. Should I a driver or the HP scanning softwar

  • LifeCam VX-6000 works do not (detected as USB20 camera)

    Hello world. My Lifecam VX-6000 stopped working a few months ago. When it is plugged in, it is detected as 'USB20 camera' and I have installed the drivers and software from the CD first, or search for a specific location with the drivers, Windows wil