Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 12    Views: 99

vtad
Aspiring developer
Profile
Posts: 40
Reg: Nov 17, 2013
Jettingen
8,700
12/02/13 09:23 AM (11 years ago)

Custom HTML, Image problem under Android

Using V 3.0 I put my image in res/drawable and in BT_Docs (myimage.jpg) I tried <img src="myimage.jpg" /> <img src="files:///android_asset/BT_Docs/myimage.jpg" /> <img src="files:///asset/BT_Docs/myimage.jpg" /> <img src="files://./asset/BT_Docs/myimage.jpg" /> none worked , with the last 3 I have in the LogCat D .............. chromium Unknow chromium error: -6 Any suggestion?
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
12/03/13 02:11 AM (11 years ago)
Put your images and html in the BT_Docs. Then don't specify a file path to the image and it will work. If you want to use a subdirectory for the images and a relative path, that works too, but it all has to be in BT_Docs. Cheers, Alan
 
vtad
Aspiring developer
Profile
Posts: 40
Reg: Nov 17, 2013
Jettingen
8,700
like
12/03/13 02:45 AM (11 years ago)
@Alan, that is the case <img src="myimage.jpg" /> - doesn't work under Eclipse/Android - seems to work under IOS. The only way I found is using somethimg like src="htttp://myserver.de/myimage.jpg", but I want to have my Image local on the device
 
vtad
Aspiring developer
Profile
Posts: 40
Reg: Nov 17, 2013
Jettingen
8,700
like
12/03/13 02:56 AM (11 years ago)
Ok, if this statement, for this plugin, is thrue: "The .html doc created with this plugin is stored on the server hosting the Control Panel" there is no (simple) way to address an image localy. So I must use something like: src="http://...../someimage.jpg"
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
12/03/13 03:09 AM (11 years ago)
Hi @vtad, I have local html files in my Android project using the approach I outlined, so I'm hoping there is something small stopping it working for you. With Android, there are certain characters that are not allowed in the image file name. Best if the name is all lower case. It can include under_scores but not-hyphens. Could it be that? Alan
 
vtad
Aspiring developer
Profile
Posts: 40
Reg: Nov 17, 2013
Jettingen
8,700
like
12/03/13 04:18 AM (11 years ago)
Hi Alan, I am using buzz V 3.0, no, nothing strange, the image file name is "ziele.jpg". The image is in assets/BT_Docs, I am not putting the html code in assets/BT_Docs - I simply use the editor of the plugin. I also tested inserting <img src="ziele.jpg" /> in BT_Docs/bt_screen_customhtml_sample.html but the image doesn't appear. I think its because of V 3.0, besides with the package explorer under Eclipse, opening the modified bt_screen_customhtml_sample.html shows the image ^^
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
12/03/13 06:24 AM (11 years ago)
Hi @vtad, What I do is I create an html doc on my PC, put the image into the same directory and test it locally. Then I copy this into my project. If I change anything, I re-install the code to my test device after a project clean. This may not be the only way, but it is my recipe. Your test sounds similar. If you are using the custom html/text plugin and putting the image locally into your project into BT_Docs, I don't think that will work. Alan
 
vtad
Aspiring developer
Profile
Posts: 40
Reg: Nov 17, 2013
Jettingen
8,700
like
12/03/13 06:59 AM (11 years ago)
"What I do is I create an html doc on my PC, put the image into the same directory and test it locally. Then I copy this into my project. If I change anything, I re-install the code to my test device after a project clean." Thats the way I used! Did you use the HTML Doc Plugin (where this procedure works) or the Custom HTML Text where it doesn't work?
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
12/03/13 07:06 AM (11 years ago)
HTML Doc Plugin. I don't believe the Custom HTML Text *can* find the image if it is local in the project. Cheers, Alan
 
vtad
Aspiring developer
Profile
Posts: 40
Reg: Nov 17, 2013
Jettingen
8,700
like
12/03/13 07:19 AM (11 years ago)
Custom HTML Text Plugin: So, after my last test. If you never add Text with the Plugins editor, the file BT_Docs/bt_screen_customhtml_sample.html is displayed, and finds images in the same directory. But in this case you should directly use the HTML Doc Plugin.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
12/03/13 07:50 AM (11 years ago)
That is my understanding. If you wish to use the html/text plug-in and it's editor, your best option may be to upload your images onto your control panel and reference them as URL's.
 
pdog
buzztouch Evangelist
Profile
Posts: 106
Reg: Nov 20, 2013
Kelowna, BC, Ca...
6,310
like
01/02/14 06:27 PM (11 years ago)
Did you resolve this issue? I had images showing ok from my html doc screens in v2.0 but now with v3.0 I get the missing image icon on my device. Images are in the same folder as the html, as before in v2. Any ideas?
 
vtad
Aspiring developer
Profile
Posts: 40
Reg: Nov 17, 2013
Jettingen
8,700
like
01/04/14 08:14 AM (11 years ago)
My work around for V 3.0: Use a "virgin" Plugin (never add Text with the Plugins editor,)then the BT_Docs/bt_screen_customhtml_sample.html and the images in the same directory are correctly displayed.
 

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.