Shorewalk
Lost but trying
Profile
Posts: 54
Reg: Nov 06, 2012
location unknow...
10,040
04/26/14 03:17 AM (6 years ago)

Images and CSS Eclipse project?

First attempt with Eclipse

I have a "complete" iOS project that I am trying to get out in the Android format.

The project's plugins consists of HTML text, Menu with image and Location Map.

I manage to run the "app" in the Android virtual device but the images are completely missing from the HTML text plugin. The images from the plugin menu with Image display (located in the res)

I have tried all different variations (res / drawable, drawable-hdpi ... assets / BT_images, assets / image.png..and so on
I just canīt get the images from pages with HTML text to be shown.

I also have a CSS file (in iOS it was placed in BT_Docs), it does not work either.

Where should the images and CSS files be placed in an Eclipse project?

/Shorewalk
 
Shorewalk
Lost but trying
Profile
Posts: 54
Reg: Nov 06, 2012
location unknow...
10,040
like
04/26/14 03:18 AM (6 years ago)
The images from the plugin menu with Image display (located in the res) are displayed
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/26/14 05:58 AM (6 years ago)
For images that relate to plugins, e.g. such menus, the images go in res/drawable.

When embedding html files in Android, I always put the css and the images in BT_Docs with the html and it works a treat. I actually use subdirectories - as long as you are careful with your url references you will be fine.

Alan
 
Shorewalk
Lost but trying
Profile
Posts: 54
Reg: Nov 06, 2012
location unknow...
10,040
like
04/27/14 02:39 AM (6 years ago)
Hi Alan
Thanks for the reply

At this point I am just unable to get the images visible on the emulator. I have tried to put the html files and images in the BT_Docs folder and tried other solutions to, but they just dont wont show up for me. So right now I donīt know quite what the problem is.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/27/14 04:02 AM (6 years ago)
Android doesn't like having hyphens in the image file name - the naming convention is very strict and case sensitive. That might be the issue, it's not uncommon.

The other thing to suggest is you could try testing the html in a browser. If the links are not quite right, that might help pinpoint the problem.
 
Shorewalk
Lost but trying
Profile
Posts: 54
Reg: Nov 06, 2012
location unknow...
10,040
like
04/28/14 08:28 AM (6 years ago)
The pages are fine in a browser and I don't have any hyphens in the file names.

The images are in png format. What I understand thats the format for Android...?

Should i point the images in a different way than:

<img src="image.png"/>
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/28/14 11:13 AM (6 years ago)
OK, good that the pages work in a browser, that proves the basics are in place. It may be the problem is the plugin are you using to view them. I use custom url plugin for displaying html on Android, for the document url, I use the following notation :

file:///android_asset/BT_Docs/mypage.html

I know it looks odd, but it works much better than the html doc plugin on Android.

Give it a go, it should work.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/28/14 11:14 AM (6 years ago)
Oh, and if you need the same source to be ios compativle, then I'd use html pro by @chris1.
 
Shorewalk
Lost but trying
Profile
Posts: 54
Reg: Nov 06, 2012
location unknow...
10,040
like
04/29/14 06:26 AM (6 years ago)
Thanks for the help

It did the trick to get the images. In portrait mode, it looks pretty good while in landscape mode the images have shrunk along the height.
I will see if I can fix it with css.

I will also try html pro to see if it can fix that problem.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/29/14 06:30 AM (6 years ago)
Good stuff, glad it worked. Css is the way; I set my images (and most everything) to have a percentage size where I can, to cope with all the different screen sizes. On images I set width but I never set height.
 
Shorewalk
Lost but trying
Profile
Posts: 54
Reg: Nov 06, 2012
location unknow...
10,040
like
04/29/14 07:22 AM (6 years ago)
Iīve just tried HTML pro using the manual that came along. I just made a test according to the manual and all worked fine.
Could i use the notation :
file:///android_asset/BT_Docs/mypage.html
in the same manner as in the plugin custom url?
The HTML pro is a bit more complicated. Where to put the notation and do I need to do some more steps?
 
Shorewalk
Lost but trying
Profile
Posts: 54
Reg: Nov 06, 2012
location unknow...
10,040
like
04/29/14 07:32 AM (6 years ago)
Iīve just tried HTML pro using the manual that came along. I just made a test according to the manual and all worked fine.
Could i use the notation :
file:///android_asset/BT_Docs/mypage.html
in the same manner as in the plugin custom url?
The HTML pro is a bit more complicated. Where to put the notation and do I need to do some more steps?
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/29/14 09:04 AM (6 years ago)
On html pro, where it say file location, all you need is mypage.html and it is the same for iOS
 

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.