mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
01/27/14 06:16 PM (11 years ago)

URL for images in html for Android

From what I recall, in previous versions of my Android apps, if I used an image in a html file then I did the following: html file in BT_Docs folder image file in res/drawable folder And then the reference to the image in the html file was simply "image.png". But now this doesn't seem to work. Should it be res/drawable/image.png?
 
Calypso Kid
Aspiring developer
Profile
Posts: 780
Reg: Mar 09, 2012
Upstate New Yor...
18,200
like
01/27/14 06:46 PM (11 years ago)
Try right clicking on your image name in the bt image folder. Select copy image url. then in the html code write <img src="paste image url here"> Dave
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
01/27/14 06:53 PM (11 years ago)
There is no BT_image folder in Android. And I don't know what you mean by copying the image url. It's a local file.
 
Calypso Kid
Aspiring developer
Profile
Posts: 780
Reg: Mar 09, 2012
Upstate New Yor...
18,200
like
01/27/14 07:58 PM (11 years ago)
sorry, i thought you were using an html plugin
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/27/14 08:18 PM (11 years ago)
It will depend on the HTML reference. If your html says something like <img src="image.png"> then place it in the same directory (and level) as the HTML file; BT_Docs Resources that are called from within code should be in res/drawable Resources that are called from within an HTML Document should be located 'relative to the HTML document source statement'. Cheers! -- Smug
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/28/14 02:29 AM (11 years ago)
Hi @Mutzy Could it be your recollection is a bit hazy? I agree with @SmugWimp. For me, this has always been the case for an html file in your project. The way I work this is to make the html and images work on my desktop with relative paths, then copy the whole lot into my project, into BT_Docs. A bonus for me is that this works equally for IOS and Android projects. Cheers, Alan
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
01/28/14 05:47 AM (11 years ago)
Yup, putting the image files in the BT_Docs folder certainly did the trick. I could have sworn Android was different in that they all went in the Res folder. Oh well... Thanks everyone! Josh
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.