LuisMa Suárez Gutiérrez
Posts: 0
Joined: Mon Aug 18, 2014 9:12 pm

i can load a picture from sirv by mapping url to the img "asset" in browser , but im getting no response in apk .

When i open my app in browser i get the images displayed by maping the sirv url form the appery database to the grid component

Image

but when i compiled the APK i dont get the images loaded.

Image

i suspect this is a cross domain call thing, but can anything tell me what im doing wrong?.
this this whtat my List_service looks like :

Code: Select all

 { 
     "_id":"5719b5e4e4b0726ab3407dc9", 
     "nombre":"Elevation Burger", 
     "_createdAt":"2016-04-22 05:25:56.206", 
     "_updatedAt":"2016-04-29 04:19:01.825", 
     "foto":"//kwarcens.sirv.com/ElevationBurger%2001.png", 
     "descripcion":"nos gusta mucho comer aqui", 
     "telefono":"9994151425", 
     "direccion":"ave motejo 13, 54", 
     "video":"a3fROjhs_VM", 

 },
Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

i can load a picture from sirv by mapping url to the img "asset" in browser , but im getting no response in apk .

Hi -

You can remotely debug your app on the device using Chrome, check out here: https://blog.appery.io/2016/02/develo...

Seems that device can't reach the file by such link:
pre//kwarcens.sirv.com/ElevationBurger%2001.png/pre

  • you will need to use absolute URL link.
LuisMa Suárez Gutiérrez
Posts: 0
Joined: Mon Aug 18, 2014 9:12 pm

i can load a picture from sirv by mapping url to the img "asset" in browser , but im getting no response in apk .

your are right.
that worked
when I mapped from my service call to my image component I added this js

return "http:"+ value+"?scale.width=280&scale.height=130";

LuisMa Suárez Gutiérrez
Posts: 0
Joined: Mon Aug 18, 2014 9:12 pm

i can load a picture from sirv by mapping url to the img "asset" in browser , but im getting no response in apk .

Just to leave this properly documented:
I mapped my service response from appery DB which gets something like :

" //kafgens.sirv.com/SushiClub%2001.png" , i got this URL from SIRV after I uploaded my image.

Image

This is the JS I wrote to that mapping.

Image

I even experimented with extracting the variables to a JS file as a constant like so:

Image

I really wasn't expecting that part to work , but it did. This allows me to find a compromise between needed quality and the data usage for the end users so I can tweak jpeg_quality setting over and over again until I find a good compression ratio.
If you have no idea what I'm talking about, It'll make sense when you start playing with SIRV. I think I'm in love.

Return to “Issues”