Page 1 of 1
Load image from data base not working on android
Posted: Wed Oct 30, 2013 9:24 pm
by Rick6334527
Hi, I am using a database service to list a table that contains an image url to an uploaded image file in the files section of the data base. The query works fine and returns the image url. I map this url to the src attribute of an image in the GUI. This also work fine in the simulator and in the chrome or native browser of android. However If I build an android app from the project the image is not displayed.
I think the problem is that I need permissions to access the image outside of the appery web page. As if I try to access the image from another browser I get an unauthorized message. Is there a way to work around this for the phonegap build.
Load image from data base not working on android
Posted: Wed Oct 30, 2013 9:44 pm
by Maryna Brodina
Hello! Could you give us example of image link?
Load image from data base not working on android
Posted: Wed Oct 30, 2013 9:55 pm
by Rick6334527
Load image from data base not working on android
Posted: Thu Oct 31, 2013 2:01 pm
by Kateryna Grynko
Hi Rick,
Is there an ability to enter a login and password for the user? From the error we can see that the user is not logged in the application and this is required for access to the database.
Load image from data base not working on android
Posted: Thu Oct 31, 2013 4:55 pm
by Rick6334527
Hi, thanks for the reply, I was hoping to do this with out the need for a login as there are just images. I was trying to keep the images out of the wrapped phonegap app so that I could change the images or add new ones without having to rebuild the app. I have moved the images into the app for now. Do you have some example code of how I would add the login session id to the request to get the image from the database?
Load image from data base not working on android
Posted: Thu Oct 31, 2013 5:53 pm
by Maryna Brodina
Hello! You don't have to login to get image. You have incorrect URL. See here direct link to a file should be http://docs.appery.io/documentation/b.... For example in your case the URL should look like this prehttps://api.appery.io/rest/1/db/files/5268291be4b0df7aeedfa0fd/fb734d3c-4d44-4486-a924-bb2e8fd66be0.prius180.png/pre
Load image from data base not working on android
Posted: Thu Oct 31, 2013 6:16 pm
by Rick6334527
Thanks, just what I was looking for.