Brad Active Member Licensed User Longtime User Jul 28, 2011 #1 I'm loading a local html file into a webview. The html code is linking images that are also stored in the asset dir. I have tried several variations with no luck. I'm sure that I'm missing something easy but it seems to be escaping me tonight. :sign0163:
I'm loading a local html file into a webview. The html code is linking images that are also stored in the asset dir. I have tried several variations with no luck. I'm sure that I'm missing something easy but it seems to be escaping me tonight. :sign0163:
Erel B4X founder Staff member Licensed User Longtime User Jul 28, 2011 #2 A small example of loading an image from the assets file is available in the manual: Basic4android - Views (Core) Note that the file names should be referenced with lower case names. Upvote 0
A small example of loading an image from the assets file is available in the manual: Basic4android - Views (Core) Note that the file names should be referenced with lower case names.
Brad Active Member Licensed User Longtime User Jul 28, 2011 #3 Thanks Erel. :sign0098: Of course it was in the manual :sign0161:..Gotta stop coding late at night. Upvote 0
aklisiewicz Active Member Licensed User Longtime User Jan 22, 2014 #4 I'm still unclear about the images. Say I have MyImage01.jpg added to the assets folder how can I sue LoadURL() method and have that image referenced in the HTML code ? or I can only use LoadHYML()? I have an activity which supposed to display an HTML file. It works but when I added an image to the HTML file and I added the file to the FILES tab the App displays only an image placeholder with the name (no image). any ideas ? Arthur Upvote 0
I'm still unclear about the images. Say I have MyImage01.jpg added to the assets folder how can I sue LoadURL() method and have that image referenced in the HTML code ? or I can only use LoadHYML()? I have an activity which supposed to display an HTML file. It works but when I added an image to the HTML file and I added the file to the FILES tab the App displays only an image placeholder with the name (no image). any ideas ? Arthur
NJDude Expert Licensed User Longtime User Jan 23, 2014 #5 To load a local picture you need to do this in your HTML: Code: <img src='file:///android_asset/mypicture.jpg'/> Upvote 0
To load a local picture you need to do this in your HTML: Code: <img src='file:///android_asset/mypicture.jpg'/>
aklisiewicz Active Member Licensed User Longtime User Jan 25, 2014 #6 that's what I needed - thank a lot! one more thing: dos this path refer for the emulator / device or both ? what wold be recommended method to download images from FTP or WEB server and store them in that folder, so they can be later referenced in WebView ? Arthur Upvote 0
that's what I needed - thank a lot! one more thing: dos this path refer for the emulator / device or both ? what wold be recommended method to download images from FTP or WEB server and store them in that folder, so they can be later referenced in WebView ? Arthur
R RjCl Member Licensed User Longtime User Mar 11, 2014 #7 NJDude said: To load a local picture you need to do this in your HTML: Code: <img src='file:///android_asset/mypicture.jpg'/> Click to expand... Is that the same for all local linked files? .js .css files etc ? im using html file that uses local image and i had in the normal html way <img src='picture.jpg'/> and it still showed ? Upvote 0
NJDude said: To load a local picture you need to do this in your HTML: Code: <img src='file:///android_asset/mypicture.jpg'/> Click to expand... Is that the same for all local linked files? .js .css files etc ? im using html file that uses local image and i had in the normal html way <img src='picture.jpg'/> and it still showed ?
Erel B4X founder Staff member Licensed User Longtime User Mar 26, 2014 #9 It is always better to start a new thread for a new question. It should work with relative links. Upvote 0