Software Archive
Read-only legacy content
17061 Discussions

Listview does not display images in the phone.

Guilherme_L_1
Beginner
453 Views

Hello. I'm beginner with Intel XDK, and I'm going through some problems with my application, and would be grateful if anyone can help me. I have a function that consumes an api, and that gives me the values ​​in json format. I receive the values with no problem. ​​I add in a listview as the code below:

 $ .each (Data, function (i, post) {

              var item = "<span style = color: # 0174DF> <h3>" + postagem.TITULO + "</ h3> <h4>" + postagem.DESCRICAO + "</ h4> </ span>";

                    . $ ("# ListaPostagem") append (item);

           });

On "postagem.DESCRICAO" (description) field often do I store an image, or links to other pages on the emulator everything works without a problem, but when I generate the APK and install to my phone the image on the listview is not shown, the links do not work, follow the link of the image used as a test:

http://imguol.com/c/entretenimento/7e/2015/06/18/fiat-fcc4-em-buenos-aires-unica-mudanca-em-relacao-a-picape-mostrada-em-sp-e-a-cor-1434644267689_615x470.jpg

And as it is stored in the database:

<p><img src="http://imguol.com/c/entretenimento/7e/2015/06/18/fiat-fcc4-em-buenos-aires-unica-mudanca-em-relacao-a-picape-mostrada-em-sp-e-a-cor-1434644267689_615x470.jpg" alt="" width="303" height="232" /></p>

I print screen the app running in the emulator and on my cell phone (Sony Xperia ZL), even did tests on two other Android devices (LG G2 and Samsung Galaxy S3). The strange thing is that when I try to debug, everything works without a problem. I'm using Bootstrap framework, but the same is true if you use the AppFramework.

Does anyone know how I can fix this?

Sincerely,

Guilherme

0 Kudos
3 Replies
Pamela_H_Intel
Moderator
453 Views

Guilherme,

It looks like your Domain Whitelisting setup is not correct. Please see the following:

https://software.intel.com/en-us/forums/topic/559482

Espero que isso ajuda. (Eu estudei na Universidade de Lisboa há muitos anos. É bom ver/ler português de vez em quando.)

Bom día!

Pamela

0 Kudos
Xavier_P_1
Beginner
453 Views

i am developing a shopping cart application when the user selects a product category they are navigated to a page which loads the list of products including associated to the category. The list would contain a combination of product details including the images. When i view the app within desktop browser or xdk simulator the images are displayed however on the physical device the images are not loaded. Please note the images are referenced from my companies website from a webservice published. this is the function i use to generate the information.

 

i have also added the following path to the cordova whitelist

http://www.sample.com/images/*

https://www.sample.com/images/*

function PopulateCateoryProducts(data){

    $('#SubCategoryList div').remove();
    var html = '';
    for(var x=0; x<data.length; x++)
    {
    
        html +='    <div class="widget widget-container content-area vertical-col uib-card cpad-3 uib_w_3 section-dimension-3" data-uib="layout/card" data-ver="'+x+'">';
        html +='        <div class="widget uib_w_'+x+' scale-image d-margins" data-uib="media/img" data-ver="'+x+'">';
        html +='            <figure class="figure-align">';
        html +='                <img  onclick="getProduct('+x+')" id="productimg'+x+'" src="http://www.sample.com/images/'+data['products_image']+'">';
        html +='            <h7>'+data['manufacturers_name']+' : '+data['products_model']+'</h7>';        
        html +='                <figcaption data-position="bottom" id="SubcategoryProduct'+x+'">Descr: '+data['products_name']+' Price: $'+data['products_price']+'</figcaption>';
        html +='            </figure>';
        html +='        </div>';
        html +='    </div>';
                
    }
    $('#SubCategoryList').append(html);
*/        
}

 

 

0 Kudos
PaulF_IntelCorp
Employee
453 Views

Since you are including the URLs directly in your html you need to add those whitelist permissions to the "allow-navigation" field, as well.

0 Kudos
Reply